I'm running Ubuntu 12.10 and I have the following 4 VirtualHost entries in /etc/apache2/apache2.conf
The 4 VirtualHost entries are for 2 separate sites, test.example.com
and test2.example.com
, one entry each for HTTP and one for HTTPS.
<VirtualHost *:443>
DocumentRoot /var/www/test
ServerName test.example.com
# Other settings goes here
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/test
ServerName test.example.com
# Other settings goes here
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/test2
ServerName test2.example.com
# Other settings goes here
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/test2
ServerName test2.example.com
# Other settings goes here
</VirtualHost>
My problem When I save and restart apache, I get this warning:-
* Restarting web server apache2 [Sun Feb 17 18:30:09 2013] [warn] _default_ VirtualHost overlap on port 443, the first has precedence ... waiting [Sun Feb 17 18:30:10 2013] [warn] _default_ VirtualHost overlap on port 443, the first has precedence
And I get the contents of /var/www/test
when I open both test.example.com
and test2.example.com
Any idea what the problem is?
NameVirtualHost *:443
in your configuration?