Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 www.f1technical.net as sometimes failing, and www.f1technical.net/forum 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
1  
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

2 Answers 2

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

 
discard

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.