2 virtual hosts on same server

17 Views Asked by At

I have a server running apache. Created 2 virtual hosts in sites-available and enabled both. If I browse to the internal IP of the server it loads the primary vhosts - which I am fine with. However, if I would like to browse the content of the 2nd virtual host, I simply get a 404

Configs below:

<VirtualHost *:80>
    ServerName test1.com
    ServerAlias www.test1.com
    DocumentRoot /var/www/html/test1
    ErrorLog  /var/log/apache2/test1-error.log
        CustomLog /var/log/apache2/test1-access.log combined
#RewriteEngine on
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
TraceEnable off
ServerSignature Off
</VirtualHost>

<VirtualHost *:80>
    ServerName test2
    DocumentRoot /var/www/html/test2
    ErrorLog  /var/log/apache2/test2-error.log
        CustomLog /var/log/apache2/test2-access.log combined
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
TraceEnable off
ServerSignature Off
#RewriteEngine on
</VirtualHost>

I have tried adding all to 1 config but no luck.

Suspect that it's something very obvious...

0

There are 0 best solutions below