Virtualhost Not working-apache

Posted January 11, 2022 72 views
ApacheUbuntu 16.04Ubuntu 18.04

As i set only one host enable all default conf are disabled then i create one more virtual host mean it redirect to first domain i use different sites also what ever while access it redirect to “"main domain”

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

Hi there,

I could suggest a few things here:

  • Make sure that the new virtual host is enabled:
ls -lah /etc/apache2/sites-enabled/

If you do not see the site there, you can enable it with a2ensite.

  • Make sure that the document root is set to point to the correct directory where your new website files are stored at.

  • Make sure to check your error log:

tail -100 /var/log/apache2/error.log

Hope that this helps!