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

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

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

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.