Question

Struggling to get apache vhost working

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


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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