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



ServerName www.seleconlight.com
DocumentRoot /var/www/www.seleconlight.com

CustomLog /var/log/apache2/www.seleconlight.com-access.log combined
ErrorLog /var/log/apache2/www.seleconlight.com-error.log

  • 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? Jun 3, 2012 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, 2012 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, 2012 at 8:26
  • This may be an entirely side issue, but why are you trying to host www.seleconlight.com on 107... when is resolves and works (for me) on What is the output of apache2ctl -S ?
    – user9517
    Jun 3, 2012 at 8:48
  • Hi, the setup above is to move it from apache2ctl -S: VirtualHost configuration: is a NameVirtualHost default server www.seleconlight.com (/etc/apache2/sites-enabled/www.seleconlight.com:1) port 80 namevhost www.seleconlight.com (/etc/apache2/sites-enabled/www.seleconlight.com:1) Syntax OK
    – jdog
    Jun 3, 2012 at 8:56

2 Answers 2


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


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .