3

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

3 Answers 3

1

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.)

0

Are there other index.XXX files? Often index.php, for example will take priority over index.html.

7
  • no other index.* files. Mar 22, 2011 at 21:08
  • Can you paste your DirectoryIndex line? Do you have another .htaccess in document root? Mar 22, 2011 at 21:10
  • No other .htaccess files. Here's the line: DirectoryIndex index.html index.txt index.php Mar 22, 2011 at 21:12
  • You don't have mod_dir disabled by some config item or minimal installation do you? This is the module that provides the DirectoryIndex function Mar 22, 2011 at 21:13
  • no, because I can go to other subdirectories on my server and get the folder listing. actually, checking it out a bit more, it seems like the "blank index" thing is only happening in the web root. any subfolders are working as expected. i'm going to update my question to reflect that. Mar 22, 2011 at 21:15
0

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:

ls -l --full-time --time=atime index.html

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .