Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
General Linux > Samba > Issue <<  51 of 98 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 11865
Last update: 11-30-07
Issue:
Why are my files failing to download or arriving corrupted when I serve them via the Apache web server in Red Hat Enterprise Linux 5?
Resolution:

If you are using an NFS or CIFS mount as DocumentRoot on the Apache web server included with Red Hat Enterprise Linux 5, you may need to disable the EnableMMAP and/or EnableSendfile options in /etc/httpd/conf/httpd.conf. They are set to "on" by default:

#
# EnableMMAP: Control whether memory-mapping is used to deliver
# files (assuming that the underlying OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems.  On some systems, turning it off (regardless of
# filesystem) can improve performance; for details, please see
# http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
#
#EnableMMAP off

#
# EnableSendfile: Control whether the sendfile kernel support is
# used to deliver files (assuming that the OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
#
#EnableSendfile off

The most common symptom of these settings being incompatible with an NFS or CIFS mounted directory is corrupted, truncated or blank files being served by the web server. Administrators may observe that files below a certain size will transfer without issue, but larger files will be truncated or come through with a zero byte file size. File commands like vi, cp or rm still work as expected on files in the mounted directory, which distinguishes this from such problems such as incorrect file permissions or incorrect mount options. The problem is only seen when accessing files inside the mounted directory through the Apache web server.

For more information, please follow these links, which are taken from the httpd.conf file excerpt shown above:

EnableMMAP
http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
EnableSendfile
http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile


How well did this entry answer your question?


good wrong incomplete out of date
General Linux > Samba > Issue <<   51  of  98  >>