HostOnNet Blog

Apache serve blank page for static files in cifs mount

We use Linux guest on WMware as development web server.

Files are stored in a windows share. This share in mounted inside DocumentRoot of apache web server.

Today i have to reinstall web server as it created some disk issue after a HDD fail.

After reinstall, static files (css, images, videos) when accessed, serve a blank file. If we save the file, we get a file of 0 byte size.

This is fixed by setting

EnableSendfile off

in /etc/httpd/conf/httpd.conf file.


Posted in Apache

  • Thankful

    Wow – thanks!!! I’ve been searching the web for an hour trying to find a fix for this. That one line fixed everything.

  • I have set EnableSendfile off,but still can’t visit the the web path
    only got the following infomation:

    Forbidden

    You don’t have permission to access /test/ on this server.

    what’s the matter with my configuration?

  • admin

    You don’t have permission to access /test/ on this server.

    This error may be due to permission. Here is the mount command i use

    /bin/mount -t cifs -o rw,user=hostonnet,password=188928989289,uid=48,gid=48,setuid=48,setgid=48,setuids,file_mode=0755,dir_mode=0755 //192.168.0.1/web /www/web
    

    48 is id for user apache that runs the web server

    [root@linux ~]# id apache
    uid=48(apache) gid=48(apache) groups=48(apache)
    [root@linux ~]#