VirtualHost for subdomain not working?


So I have successfully added a DNS record for my subdomain. Now I have access to “

I then created a new virtualhost for my subdomain in /etc/apache2/site-availables/000-default.conf :

<VirtualHost *:80>
ServerAdmin DocumentRoot /var/www/blog/ ServerName ErrorLog /var/log/httpd/blog/error.log </VirtualHost>

saved it and restarted apache.

But nothing changes… when I browse it still shows my main website. Obviously i have created a new folder (“blog”) in /var/www and uploaded wordpress via FTP.

Am I missing something?

Thank you!


Submit an 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.

i followed the same method but it’s not working for me

I used another method but thank you for your time :) (it still doesn’t fully work though since I get a blank page)


You need to create a new VirtualHost (new file)



  sudo service apache2 restart

Here you go