Friday, March 13, 2015

apache 2.2 - Ubuntu 12.04 cloud edition on Amazon - Apache2 - /etc



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



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




Listen 443



sites-available/www.seleconlight.com





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



Answer



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



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...