Let assume that blah.com
, blah2.com
all point to the same server with IP=5.31.111.7
.
I would like that:
accessing
blah.com
serves/var/www/site1
accessing
blah2.com
serves/var/www/site1
accessing
5.31.111.7
serves/var/www/site2
I tried
<VirtualHost *:80>
DocumentRoot /var/www/site1
</VirtualHost>
<VirtualHost 5.31.111.7:80>
DocumentRoot /var/www/site2
</VirtualHost>
but now everything goes to /var/www/site2
, which is not what I wanted.
How to configure the VirtualHost
, such that the served website depends on the URL ?
PS: why should I do this in /etc/apache2/sites-enabled/000-default
instead of /etc/apache2/apache2.conf
? I don't understand this sites-enabled
/ sites-available/default
naming... Why are there so many different config files by default on Debian, for such a simple thing?