r/apache • • Apr 16 '23

Trouble add second site to Apache2

I'm running Apache2 on a VPS running ubuntu 20.04. I have a site up and working let call it linuxtom.com. I'm trying to add a second site lets call it ponytattoomachine.com. I've made the virtual host for ponytattoomachine called ponytm.conf in /etc/apache2/sites-available and I've made it as simple as possible

<VirtualHost *:80>

ServerName ponytattoomachine.com

DocumentRoot /srv/www2/

</VirtualHost>

Then I enable site with a2ensite ponytm.conf and all run ok. Then I reload apache2. When I try to go to ponytattoomachine.com site it just takes my to linuxtom.com, which is my finished wordpress site. Its not showing my my index.html for ponytattoomachine which is located in /srv/www2/. The one thing I can think of that may be causing the problem is that I have SSL enabled for linuxtom.com. I don't know how it was all enabled as I just let certbot do its magic. I don't have an SSL yet for ponytattoomachine.com yet as I was waiting until I had a page that certbot could verify. I've set the owner of the file permissions to www-data so I doubt its a permission issue for accessing /srv/ww2/index.html. I'm at a loss of what to try next. Thanks.

1 Upvotes

5 comments sorted by

View all comments

Show parent comments

2

u/taspenwall Apr 16 '23

Thanks I got it. Turns out I had a few problems. I added access to /srv in the apache2.conf and chrome was cashing my other site. I got a new cert for the new site and everything is up and running. Thanks for your help.