Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have setup a web server on Amazon with 3 Virtual hosts. For some reason I can't get any of the sites going on it, they all show a 404 error. /var/log/apache2/error.log shows "File does not exist: /etc/apache2/htdocs"

I have checked:

  • a2ensite all my virtual hosts
  • actually checked softlinks in sites-enabled
  • access rights in /var/www to 777, in case user is not www-data
  • grep -r htdocs /etc/apache2 (returns nothing)
  • ports.conf has NameVirtualHost directive exactly matching Virtual Hosts

What else could this be?


# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443

<IfModule mod_gnutls.c>
    Listen 443



DocumentRoot /var/www/

CustomLog /var/log/apache2/ combined
ErrorLog /var/log/apache2/

share|improve this question
Your document root shouldn't be within /etc, it should be /var/www if that's what you're trying to use. And you shouldn't use 777 permissions. Do you have DocumentRoot htdocs configured in one of your vhosts or something? Where'd these configs come from, and can you show them to us? – Shane Madden Jun 3 '12 at 7:35
Pls see the vhost. I don't know where the /etc/apache/htdocs comes from, see my grep command. – jdog Jun 3 '12 at 8:23
I don't see why this has been downvoted, obviously I have already checked in 5 areas that work fine on the other 5 servers I manage – jdog Jun 3 '12 at 8:26
This may be an entirely side issue, but why are you trying to host on 107... when is resolves and works (for me) on What is the output of apache2ctl -S ? – Iain Jun 3 '12 at 8:48
Hi, the setup above is to move it from apache2ctl -S: VirtualHost configuration: is a NameVirtualHost default server (/etc/apache2/sites-enabled/ port 80 namevhost (/etc/apache2/sites-enabled/ Syntax OK – jdog Jun 3 '12 at 8:56
up vote 1 down vote accepted

Maybe try to reinstall Apache with apt-get remove/ apt-get install

share|improve this answer

Check your configuration files it looks like you've got a misconfigured DocumentRoot directive.

You really don't want to have 777 perms anywhere in the web accessible part of your filesystem either.

share|improve this answer

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.