Apache serving incomplete responses from smb mounted directories

apache-2.2httpserver-message-block

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

Best Answer

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.

Related Topic