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>
and the 1st working site is
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName linuxtom.com
ServerAlias www.linuxtom.com
DocumentRoot /srv/www/wordpress
<Directory /srv/www/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
Require all granted
</Directory>
<Directory /srv/www/wordpress/wp-content>
Options FollowSymLinks
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =linuxtom.com [OR]
RewriteCond %{SERVER_NAME} =www.linuxtom.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</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. Also one thing to note is when I a2dissite my wordpress site and its SSL counter part and just have ponytm.conf enabled and try to go to ponytattoomachine.com it does not load and my URL still changes to linuxtom.com. Thanks