Question

Struggling to get apache vhost working

Posted April 17, 2021 202 views
ApacheUbuntu 20.04

I’m following through this guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-18-04

I’m trying to set my droplet up for two subdomains

wiki.domain.dev & dnd.domain.dev

I believe I’ve followed the tutorial to the letter but I am having trouble, when I try connecting to the directly the IP it takes me to the page i designated for dnd.domain.dev

Neither wiki.domain.dev & dnd.domain.dev are able to connect.

I’ve pointed my domain at the name servers through my domain registrar and assigned wiki.domain.dev and dnd.domain.dev to the correct droplet.

These are my conf files stored in /etc/apache2/sites-available/ and activated with a2ensite:

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        ServerName dnd.domain.dev
        ServerAlias www.dnd.domain.dev
        DocumentRoot /var/www/dnd/public



        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        ServerName wiki.domain.dev
        ServerAlias www.wiki.domain.dev
        DocumentRoot /var/www/dnd/public



        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

If anyone can see an error or provide assistance I would greatly appreciate it

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Just as I am playing with it, if I ping my domain and subdomain, the correct IP is being pinged and confirm with dnschecker.org/ that the correct name servers are associated.

Also not sure if necessary for troubleshooting, but the domain is mpg.dev