Second Website on Subdomain

Posted June 9, 2020 1.1k views

I am trying to set up another website on a subdomain.

I have followed the tutorial and forum post below but got no results:

I’ve a wordpress website running on /var/www/html. I have created another website on /var/www/sanaltur and created a apache config file as follows:

cat /etc/apache2/sites-available/

UseCanonicalName On

<VirtualHost *:80>


        DocumentRoot /var/www/sanaltur/

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

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


Then I used:

  • a2ensite

command to enable the conf file.

Still, I can’t reach to subdomain.

Thank you for your help

edited by bobbyiliev

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 @altugguzeloglu,

The configuration looks all correct. What you need to do is also add a DNS A record for your subdomain name to point to your Droplet’s IP address.

Once you add the A record for your domain, it might take up to 24-48 hours for the DNS cache to clear over the Globe before you could see the actual DNS changes.

Let me know how it goes!