Apache config file with multiple VirtualHosts

I wanted to be able to open sites like *.ladby.ru and *.lovecakes.ru besides main sites ladby.ru and lovecakes.ru. This is how I solved this problem – by editing Apache config file, making it much simpler and by using ServerNames instead of ServerAliases.

And this is how the tree looks like:
Снимок экрана 2014-08-13 в 16.57.17

Do not forget to reload Apache after editing conf file, which lies here: /etc/apache2/sites-available:

So, now the following sites are working:
club.ladby.ru
ladby.ru
www.ladby.ru
lovecakes.ru
www.lovecakes.ru
galina.lovecakes.ru

One thought on “Apache config file with multiple VirtualHosts”

Leave a Reply

Your email address will not be published. Required fields are marked *