2

I'm running "Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch" inside a virtual machine (debian lenny, up2date) with NAT and about 60% of any http response gets served "incomplete" when serving requests from smb mounted directories (i.e. from the vm host).

My problem is, i cannot see any pattern which response when fails, because they kind of rotate. But what i can see is, that some requests like jquery ui always gets truncated at the same position (javascript console reports syntax error).

This is an example header of a response that was incomplete:

Date Fri, 04 Sep 2009 21:09:38 GMT Server Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny3 with Suhosin-Patch Last-Modified Sat, 20 Jun 2009 11:53:52 GMT Etag "1810-2f074-46cc64b731400" Accept-Ranges bytes Content-Length 192628 Connection close Content-Type application/javascript 

Enabled apache2 mods:

alias.conf authz_user.load dir.load php5.load alias.load autoindex.conf env.load rewrite.load auth_basic.load autoindex.load mime.conf setenvif.conf authn_file.load cgi.load mime.load setenvif.load authz_default.load deflate.conf negotiation.conf status.conf authz_groupfile.load deflate.load negotiation.load status.load authz_host.load dir.conf php5.conf 

Only .js and .png files are affected in my particular project. The "main request" always loads fine.

update: apache2ctl -m output:

Loaded Modules: core_module (static) log_config_module (static) logio_module (static) mpm_prefork_module (static) http_module (static) so_module (static) alias_module (shared) auth_basic_module (shared) authn_file_module (shared) authz_default_module (shared) authz_groupfile_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) cgi_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) mime_module (shared) negotiation_module (shared) php5_module (shared) rewrite_module (shared) setenvif_module (shared) status_module (shared) Syntax OK 
2
  • To list the loaded Apache 2 modules please run httpd -M, that what you have provided is just a list of files and does not help us in maybe locating the issue. Commented Sep 4, 2009 at 21:34
  • Please list the full response headers. The example you gave doesn't include the response status code. Is the reported Content-Length (192628) the same as the actual size of the file you are trying to download? Commented Sep 5, 2009 at 0:14

2 Answers 2

4

I've seen this when serving files from SMB- or CIFS-mounted shares. Try turning off sendfile support using:

EnableSendfile Off 

You can do this in the main server configuration, .htacces file or in a vhost/directory block.

4
  • Glad to be of service! Commented Sep 6, 2009 at 11:43
  • PS to make it easier for Google and others with the same problem can you edit your question to say you're serving from an SMB mount? Thanks! Commented Sep 6, 2009 at 15:28
  • @markdrayton: done Commented Sep 7, 2009 at 15:43
  • OMG This has stumped me for the past week. We ran into it when we switched a Docker-based web application (FileRun) from accessing volumes over NFS to accessing them over SMBv3. Thank you so much! Commented May 28, 2021 at 3:09
0

Well, i switched the files from a mounted windows smb-share to a local directory, and it now works fine. I don't have the time to investigate this further, but i think the problem was not related to apache itself.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.