A Windows Server 2003 share mounted on a Linux system that works in otherwise every other way fails to transfer files through apache 2.2.4 /etc/fstab entry: //server/share /mnt/data cifs credentials=/root/.samba/credentials 0 0 (alse experimented with rsize=32768,file_mode=0664,dir_mode=0775,nomapchars,noacl,nobrl,sfu,gid=apache,uid=apache) The virtualhost is simply: <VirtualHost *:80> ServerAdmin xxx@9jr.com # DocumentRoot /web/9jr.com/html DocumentRoot /mnt/data ServerName 9jr.com ServerAlias *.9jr.com ErrorLog logs/9jr.com-error_log # CustomLog /dev/null common CustomLog logs/9jr.com-access_log common # RewriteEngine On # Pattern Substitution <Location /> Options Indexes FollowSymlinks MultiViews </Location> Alias /pics "/BACKUP/pics" <Directory "/BACKUP/pics"> Options Indexes FollowSymLinks MultiViews </Directory> DirectoryIndex index.cgi index.html index.htm </VirtualHost> No other mounted filesystem displays this behavior This behavior was confirmed on FC7 and CentOS5
Directory traversing works great. On CentOS 5, around 32K is transmitted before the connection is closed. A larger image than 32K can be eventually downloaded with repeated go button push. On FC7, 0 bytes are transmitted. I used wget to see what happens: $ wget http://dev.9jr.com/Mvc-005s.jpg --21:17:57-- http://dev.9jr.com/Mvc-005s.jpg => `Mvc-005s.jpg' Resolving dev.9jr.com... 66.92.42.141 Connecting to dev.9jr.com|66.92.42.141|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 25,177 (25K) [image/jpeg] 0% [ ] 0 --.--K/s 21:18:00 (0.00 B/s) - Connection closed at byte 0. Retrying. --21:18:01-- http://dev.9jr.com/Mvc-005s.jpg (try: 2) => `Mvc-005s.jpg' Connecting to dev.9jr.com|66.92.42.141|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 25,177 (25K) [image/jpeg] Mvc-005s.jpg has sprung into existence. Retrying. --21:18:03-- http://dev.9jr.com/Mvc-005s.jpg (try: 3) => `Mvc-005s.jpg.1' Connecting to dev.9jr.com|66.92.42.141|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 25,177 (25K) [image/jpeg] 0% [ ] 0 --.--K/s 21:18:03 (0.00 B/s) - Connection closed at byte 0. Retrying.
Please set the following configuration directives in your httpd configuration and check if the problem persists: EnableSendfile Off EnableMMAP Off See also http://httpd.apache.org/docs/2.2/en/mod/core.html#enablesendfile http://httpd.apache.org/docs/2.2/en/mod/core.html#enablemmap It is well know that network mounted file systems like NFS, SMB or CIFS can cause these kind of problems in conjunction with sendfile and mmap.
Thank you! EnableSendfile Off did the trick. I guess I limited my searches to CIFS because I was not seeing a problem with NFS mounts. I wonder if I should contact the APR list about this, as apr_socket_sendfile must be the culprit. Also, should I set the status of the bug to 'FIXED' or something else like 'WONTFIX' ? Thanks again
(In reply to comment #3) > Thank you! > > EnableSendfile Off > did the trick. I guess I limited my searches to CIFS because I was not seeing a > problem with NFS mounts. > > I wonder if I should contact the APR list about this, as apr_socket_sendfile > must be the culprit. No need to do. This is a well known OS problem with sendfile and network file systems on OS'es that support sendfile. > > Also, should I set the status of the bug to 'FIXED' or something else like > 'WONTFIX' ? I mark it as invalid as it is the documented behaviour.