0

WHile trying to replicate Apple Airscan protocol I am getting this error on the POSTed file upload. This is from Mopria Android client to the Apache server so I can not change anything on the client end.

192.168.0.8 - - [16/May/2019:02:11:19 -0500] "POST /eSCL/ScanJobs 
HTTP/1.1" 404 506 "-" "okhttp/3.9.1"

I even set /eSCL/ScanJobs for 777 permissions

404 not found 506 refers to space

Server version: Apache/2.4.18 (Ubuntu)

I have been through the wringer with this so far and now so close but yet so far for small problems like this

Need change something in apache2.conf to allow the upload or is changing permissions sufficcient? As of yet I have built nothing to process the file but thinking it should post

Here is the additional info: aftter Original Post------------------------

Thanks for recognising that is from a log file.

the server root is /var/www/html The error refers to /var/www/html/eSCL/SanJobs which is a valid directoy with ownership of www-data (appropriate for Ubuntu Linux) and 777 permissions.

There is no misconfiguration that I can see as the main index.php lies at /var/www/html and loads correctly

This is nearly a defualt install on ubuntu linux, installed on localhost.

The POST is coming fom a Mopria Android Client

I have added the following to Apache2.conf to deal with no trailing slashes with no redirects

<Directory /var/www/>
   <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME}.php -f
      RewriteRule (.*) $1.php [L]
      RewriteCond %{REQUEST_FILENAME}.xml -f
      RewriteRule (.*) $1.xml [L]
  </IfModule>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

there is also an .htaccess file with the following:

DirectorySlash Off
#RewriteOptions AllowNoSlash

This leaves me with the question , as to what I must do to parse the POST request? I mean I know I will use PHP to parse it later, but want to get the file before I move on. The file should still be POSTed without any handling , correct?

  • Post your Apache configuration. Post your actual permissions (of the directory, the files and all parent directories). The error log of your Apache might also contain clues. – Gerald Schneider May 16 at 7:26
1
192.168.0.8 - - [16/May/2019:02:11:19 -0500] "POST /eSCL/ScanJobs HTTP/1.1" 404 506 "-" "okhttp/3.9.1"

That is a log line in the extended log format http://httpd.apache.org/docs/current/mod/mod_log_config.html

The 404 in that log entry is indeed a "file not found" error response.

That means that, relative to the DocumentRoot you configured in Apache, the file /eSCL/ScanJobs was not found. In general the DocumentRoot is something like /var/www/html and the file requested maps to /var/www/html/eSCL/ScanJobs.

The 506 refers numbers to the number of bytes apache sent in response to the request (a bit of text saying "Error 404: file not found" probably).

Need change something in apache2.conf to allow the upload or is changing permissions sufficcient?

HTTP Post request can't be parsed by static content and need a a script or executable to process them. Since ScanJobs has no file extension Apache can't know if that file is for instance a PHP script, a Perl script, an executable or something else. You will need to configure apache accordingly.

  • I added more info to this – Tekno Geekz May 16 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.