So I'm trying to set up a rackspace cloud server to host multiple sites (not servers) with a single IP. I installed Virtualmin/Webmin on an Ubuntu 12.04 LTS server. I created the directory /var/www/sites/testsite. Then I created a virtual host under Webmin->Servers->Apache Webserver with the following settings:
Address: Any
Port: 80
Document Root: /var/www/sites/testsite
Server Name: testsite.com
Then, to test it, I edited the hosts file on my local machine and added
[my.server.ip.address] testsite.com
Then went to testsite.com in my browser and problem is it's loading the default site (at /var/www) instead of the virtual one I just created (I verfied this by adding different index.html files in /var/www and /var/www/sites/testsite).
Here are the directives webmin created in /etc/apache2/sites-available/webmin.1372454178.conf
DocumentRoot /var/www/sites/testsite
<Directory "/var/www/sites/testsite">
allow from all
Options +Indexes
</Directory>
ServerName testsite.com
ServerAlias www.testsite.com
i fixed this by adding directive ServerAlias domain.tld *.domain.tld
You can find this for setup under Apache -> Your Virtual Domain settings -> Networking and Addresses -> Alternate virtual server names FIELD.
domain.tld *.domain.tld
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With