Report this

What is the reason for this report?

Problem with virtual host

Posted on August 3, 2022

Hello,

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

I have tried to follow the tutorial

And as a result, faye.tekky.site work! but not tekky.site

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

<VirtualHost *:80>
        ServerAdmin admin@tekky.site

        ServerName tekky.site
        ServerAlias www.tekky.site

        DocumentRoot /var/www/tekky.site/public_html

        <Directory /var/www/tekky.site/public_html>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

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



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!

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.

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:

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04

  • 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

Best,

Bobby

This comment has been deleted

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.