Fix Virtual Host Not Working on Cloud Server Running Ubuntu and Apache2 Web Server with only few easy steps. If you follow our guide to Install WordPress or any Web Software on Ubuntu on Rackspace Cloud or Digital Ocean and try to modify the default one server one domain settings – which is actually enabling virtual hosts; you might end up serving wrong directory content for particular named website. This basically happens due to a very small mistake.
Virtual Host Not Working on Cloud Server Running Ubuntu : Why You Did?
Practically all will perform the exact steps to enable name based virtual host. which is written in our guide to host Multiple Websites on Ubuntu 13.10 on Rackspace Cloud Server. We basically perform few steps :
1 2 3 4 5 6 7 8 | # we copy the config file sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf # we edit the newly created site's config file to point to proper directory sudo nano /etc/apache2/sites-available/example.com.conf # we activate the config sudo a2ensite example.com # we restart apache sudo service apache2 restart |
At this point, pointing the domain from cloud dns or any dns service towards the server IP with A record should work. But, it is also important to disable the default site :
---
1 2 3 4 | # this disables the default sudo a2dissite 000-default # restart apache sudo service apache2 restart |
These are correct steps. However, if you want to add 3 or more websites, usually the problem starts.
Fix Virtual Host Not Working on Cloud Server Running Ubuntu
Actually adding one line on problem creating website’s config file will solve the problem :
1 2 3 4 | # add NameVirtualHost * # before the block starts <VirtualHost *:80> |
This is kind of quick fix for Name Based Virtual Host on Debian system. Obviously you must check the basic points like the directory path, file permission, any .htaccess based rules (if old website is imported) etc.
Tagged With odbc is the server running on host