I have an Apache 2.2.3 server running on CentOS 5.5. In the root of my web directory, there is an index.html file.
Going to something like, say, www.exampledomain.egg/index.html
works, but going to www.exampledomain.egg/
displays a completely blank page. I've double checked the DirectoryIndex
option and still, nothing.
It seems as if this only affects the root of the domain. If there is a subdirectory, like www.exampledomain.egg/iamafolder/
, that will display its own DirectoryIndex as normal.
Here's what I have in the .htaccess file:
DirectoryIndex index.html index.txt index.php
Check the apache access log file to see that you are indeed requesting the correct file. Also check the index file for any run-away tags (e.g. missing
</head>
that could cause the whole document to be parsed as header information only.)Are there other index.XXX files? Often index.php, for example will take priority over index.html.
One thing you can try is checking to help troubleshoot is the last access time of the index.html file in question. First you'll need to make sure that atime flags are updated on your filesystem. Run mount and see if the filesystem that your document root is on has a noatime flag set. If it does, then you aren't updating the atimes of files and will need to remount it without this flag. Otherwise, it should be updating the atimes.
Now that you've done, that, just run this:
Then wait a few seconds and then try to access http://www.exampledomain.egg/ then go back to the shell and run that ls command again and see if the atime has changed.
If the atime didn't change:
See if you still have the default welcome.conf turned on in /etc/httpd/conf.d/ It could be that the welcome error file is blank or something and you're matching that. The default match there only matches at the root, which sounds like what you are encountering.
If the atime did change:
Make sure the index.html file isn't really empty? cat index.html
Also, you didn't mention whether you checked the source in your browser on the blank page to see if it is really empty or if it just has invisible content.
Use a different browser to verify that the problem is on the server end:
curl http://www.exampledomain.egg/
And its ok if it really had invisible content, I've fooled myself a few times into thinking this so don't kick yourself too hard.