Sunday, October 30, 2016

linux - Apache Virtual Hosts Not Working

EDIT: I was able to get this to work. There was a VirtualHost entry in httpd.conf that was effecting the Virtual Hosts in my vhosts.conf file.



I am trying to set up a CentOS server and configure it with two virtual hosts. This server is going to be replacing a Solaris server with the same settings. On the Solaris (current) server, the virtual hosts work, but on the new server, the first one is called regardless of what sent it (modifying hosts file).




SSL virtual host works.



I have tried to add "NameVirtualHost *:80", but get




[Thu Jun 30 14:43:38 2011] [warn] default VirtualHost overlap on port 80, the first has precedence
[Thu Jun 30 14:43:38 2011] [warn] NameVirtualHost *:80 has no VirtualHosts





Does anyone have any ideas?



EDIT: I forgot to post my configurations.




NameVirtualHost *:80
...

DocumentRoot "/var/www/html/domain1"
ServerName domain1
ServerAlias www.domain1

AllowOverride All
Options None
Order allow,deny
Allow from all

DirectoryIndex index.html index.php


DocumentRoot "/var/www/html/domain2"
ServerName domain2
ServerAlias www.domain2

AllowOverride All
Options None
Order allow,deny
Allow from all

DirectoryIndex index.html index.php


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