Question Details

Browse

Apache Bug?

By Nadir Hussein - Jul. 05, 2008

I can't seem to find any evidence on the web of a "bug" with apache that I am experiencing. It appears that apache does not follow symbolic links when the file size is greater than 2 GB. That is, I try to link an ISO file (which resides in, say, /usr/local/some_dir/iso_file) to /var/www/html/some_directory/symlink_to_iso however all other symlinks appear, except those in which the filesize is greater than 2GB. In other words, they are all visibly there in the shell, but when you surf to the apache page to view it:
http://somehost/some_directory/ you see all symlinks but the ones that are big (2+ gb). The big ones don't even appear. Try it, and see for yourself!

I know plenty of other programs (like tar) have filesize limitations or issues with files over 2GB, but I haven't been able to find anyone saying that apache has this problem. I have tried this on FC6,7,and 8 with the latest version of httpd for each, and the results are the same. Do you have any insight as to why this is, and why no one seems to talk about this phenomenon on the web? Or am I just going slowly insane?

BTW, permissions/ownership aren't the issue. The issue is definitely with the filesize. There are not reports of this in the logs (everything seems fine to apache).

Do you have any idea why that is???


Answers

Add Answer
  1. By Randy Clark on Jul. 07, 2008

    Does it work if it is not sym-linked? What if you have it in your htdocs folder? What if you have the parent folder sym-linked? It could very well be a limitation - have not seen that before, but haven't tried it either.


    0 Votes
  2. By Mike Thomas on Jul. 07, 2008

    If you have narrowed it down to file size then it is really obvious. Your Apache was compiled for 32bit machine and has a 2 GB file size limit.


    Now, I am not sure what version of Apache is in play, but I would expect one of the more recent ones. It might be just the module for symlink processing, mind you. It could easily happen that if you place the file directly, it will be visible and downloadable. You should know that Apache has it's own processing of symlinks, since one of directory directives can disallow following of symlinks. Maybe they forgot to use "long", and left "int" as the type. That causes overflow and apache bails out on the symlink.


    Your options are:


    1. If it is a 64bit machine, install 64bit version of Linux and Apache

    2. Try to let Apache serve the directory directly.


    For last option, you could use Alias directive in Apache's config.


    http://httpd.apache.org/docs/2.2/mod/mod_alias.html


    Cheers!


    0 Votes
Share your knowledge