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.

I'm new to setting up servers, working with Apache2, etc. While attempting to post html documents, I:

  1. dropped a html file in the 'www' directory.
  2. ran this command in the command prompt: iptables -I INPUT -p tcp --dport 80 -j ACCEPT
  3. visited the appropriate URL.

However, I am directed to a 404 not found page.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

If you get 404 your port is open and web server is running but the html file was not found. Usually the correct dir is /var/www/html. Put file.html into /var/www/html and try accessing it http://server/file.html

The default file is named index.html. If you put file named index.html into the dir you should be able to access the server with http://server/

share|improve this answer
add comment

Since you see a 404 error, you are getting through on port 80.

You may be experiencing permissions problems. Make sure your html file and parent directory is readable by apache(making them world readable will suffice for now):

chmod -R a+r /path/to/www

Are you specifying the full url to your html file like http://someserver/myfile.html, or do you just go to http://someserver/? If it is the latter, make sure your file is named index.html.

share|improve this answer
3  
It doesn't need to be world readable, just readable to the httpd account and it's group; usually www-data or apache depending on the distro. –  MDMarra Nov 10 '11 at 18:21
    
Good point. Thank you for clarifying. –  Jeff Strunk Nov 10 '11 at 18:29
add comment

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.