I am quite a noob on Ubuntu but I had to install it on a VPS to display two different websites as sub-domains. One of them is a Drupal 8 website, the other one is a Static html website (index.html)
I got both websites on /var/www and I think I configured everything correctly on apache2 because I added the two subdomains to hosts
file to access locally and do some tests and they work fine.
When I type old.myaddress.com
or new.myaddress.com
both of them load locally. However, if I try to access through internet or from another computer, it will only load the Drupal one, always. Why?
Worth to mention that I got a Domain and configured both old.myaddress.com
and new.myaddress.com
subdomains to redirect to the same IP (my VPS server IP). As far as I understand, apache should send the user to the different sites?
These are my .conf files inside etc/apache2/sites-available
:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.myaddress.com
ServerAlias old.myaddress.com
DocumentRoot /var/www/oldwebsite/myaddress.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.myaddress.com
ServerAlias new.myaddress.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
To clarify, I'm asking where the missing configuration is. If loading the websites locally works, it may still be apache? It's my DNS? my ISP? Drupal configuration? I'm quite lost.