Problem with virtual host


I want to have two websites on the same server. First domain would be and a subdomain as

I have tried to follow the tutorial

And as a result, work! but not

i can’t figure out the problem. Here’s the configuration file in apache folders:

<VirtualHost *:80>


        DocumentRoot /var/www/

        <Directory /var/www/>
            Options FollowSymLinks
            AllowOverride All
            Require all granted

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

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.

This comment has been deleted

Hi there,

I can see that both of your sites are up and running now. Would you mind sharing how did you sort out the issue?

Usually, in such cases, I recommend the following:

  • Make sure that both sites have an SSL certificate, otherwise, if only 1 site has an SSL certificate, if you visit the second site via HTTPS you would be seeing the contents of the first site as it is the only one having VHost configured for port 443:

  • Make sure that the permissions of both sites are correct so that the Apache www-data user has access to read the directories

  • Check the Apache error log for more information:

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