Voyager529's picture

Good day everyone!

Despite having been using TKL for nearly a decade now, this is my first foray into trying to host multiple websites using the LAMP appliance. The first website works fine. The second...not so much.

I got the first one working by putting my content into /var/www and just let the default site be the default. It works perfectly.

I tried adding a second one using the Webmin GUI, but wasn't terribly successful. So, I copy/pasted the 000-default.conf to be server2.example.com, changing the path to be /var/www/server2.example.com, within which is a valid path and has a simple index.html file in it. Webmin shows the new addition, but the second site doesn't show its index page, even with a host file on a LAN. Instead, it shows the default site.

Here are the two .conf files:

000-default.conf: https://pastebin.com/NphZJHmi

server2.example.com: https://pastebin.com/saP1WUaB

I am 99% sure I have made no manual changes to apache2.conf, but it is available upon request if needed.

Thank you for the assistance and consideration!

 

-v5

Forum: 
Bill Carney's picture

Did you run these commands?

a2ensite server2.example.com

service apache2 reload

Voyager529's picture

Thanks Bill!

 

a2ensite server2.example.com

service apache2 reload

Those commands are exactly what I needed to do!

Bill Carney's picture

FWIW my site.conf file looks like this (I keep my html files inside the site.com/htdocs directory, old habit I guess:

<VirtualHost *:80>
    ServerName site.com
    ServerAlias www.site.com
    ServerAdmin webmaster@site.com

    DocumentRoot /var/www/site.com/htdocs

    <Directory />
        Options FollowSymLinks
        AllowOverride All
    </Directory>

    <Directory /var/www/site.com/htdocs>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

</VirtualHost>

Add new comment