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

ports.conf 

# 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

NameVirtualHost 107.20.169.163:80
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>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>


sites-available/www.seleconlight.com


<VirtualHost 107.20.169.163:80>

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

</VirtualHost>
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 www.seleconlight.com on 107... when is resolves and works (for me) on 119.47.125.193? What is the output of apache2ctl -S ? –  Iain Jun 3 '12 at 8:48
    
Hi, the setup above is to move it from 119.47.125.193. apache2ctl -S: VirtualHost configuration: 107.20.169.163:80 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 '12 at 8:56
add comment

2 Answers

up vote 1 down vote accepted

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

share|improve this answer
add comment

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