Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It appears that apache is sending 404 status sometimes when someone performs a "GET /" request. Sometimes it works though.

For the cases it doesn't, visitors are presented with a blank page. Any other part of the site works. You can check as sometimes failing, and as always working.

I have tried replacing the homepage with a simple "hello" in the file, but that doesn't matter. I tried a lot but don't really know where to look further.

Any guesses what might be causing this?

EDIT: It turns out that this was caused by an incompatibility in php code.

Problem is really that PHP errors are not logged correctly, so I have been looking at the wrong place all the time.

Thank you for your contributions!

share|improve this question
Logs or it didn't happen. – womble Jul 19 '11 at 19:28
Have you seen this problem yourself, and can you corroborate it user the server logs? Feedback from users isn't always reliable, and many people don't know the difference between a '404' and any other error. It could be anything: User error, serverside problems, DNS poisoning outside your network, etc. – Stefan Lasiewski Jul 19 '11 at 20:30
Yes I've noticed it myself repeatedly. Checking the apache logs also clearly shows that 404's are the response to "GET /" requests. – Steven De Groote Jul 19 '11 at 21:02
@womble dropped it a little bluntly, but either way you still need to look at your logs. – Jacob Jul 19 '11 at 23:09
And more to the point, we need to look at your logs. And not just the access log, either -- full error logs for the time periods in question. – womble Jul 19 '11 at 23:24

Do you have more than one A record for the domain name you're using to access the site? That's one of the very few ways to randomize the result of a HTTP request in the way you've described (without explicitly setting out to do so, of course).

share|improve this answer
What would be the best way to check that? (I'm on debian etch) – Steven De Groote Jul 19 '11 at 21:04
Etch? Duuuuuuude... dig <hostname> and if it comes up with more than one A record in the answer section, BMDan gets a cookie. – womble Jul 19 '11 at 23:25

Do you have index.php file inside your document root ?. It seems like you don't have anything else configured in the "DirectoryIndex" directive in apache conf other than index.php as this page is the one causing 404 and your index.html not getting processed as well. Try the following in your .htaccess file and check the results.

DirectoryIndex index.php index.html index.htm

share|improve this answer
Yes the file is there, and it works sometimes too. I have no idea when it does, it's not related to browser type or browser caching, that's all I know really... – Steven De Groote Jul 19 '11 at 21:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.