Quando scrivo
cat /etc/apache2/sites-enabled/*
Vedo
<VirtualHost *:80>
ServerName myserver
DocumentRoot /var/www/
</VirtualHost>
<VirtualHost *:80>
ServerName www.mydomain1.net
DocumentRoot /var/www/www.mydomain1.net/public/
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain1.net
RedirectMatch permanent ^/(.*) http://www.mydomain1.net/$1
</VirtualHost>
<VirtualHost *:80>
ServerName www.yasser.com
DocumentRoot /var/www/www.mydomain2.com/public/
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain2.com
RedirectMatch permanent ^/(.*) http://www.mydomain2.com/$1
</VirtualHost>
Quando navigo su mydomain1.com e mydomain2.com, vedo i contenuti da "myserver" che è l'elenco delle directory in /var/www
.
Cosa sto facendo di sbagliato qui?
Anche qui è l'output di apachectl -S
:
*:80 is a NameVirtualHost
default server myserver (/etc/apache2/sites-enabled/myserver:1)
port 80 namevhost myserver (/etc/apache2/sites-enabled/myserver:1)
port 80 namevhost www.mydomain1.net (/etc/apache2/sites-enabled/www.mydomain1.net:1)
port 80 namevhost mydomain1.net (/etc/apache2/sites-enabled/www.mydomain1.net:6)
port 80 namevhost www.mydomain2.com (/etc/apache2/sites-enabled/www.mydomain2.com:1)
port 80 namevhost mydomain2.com (/etc/apache2/sites-enabled/www.mydomain2.com:6)