alfielyon
By:
alfielyon

Hosting Multiple Websites using Webmin & Ubuntu 14.05 - Additional Domains Redirect To Primary Domain

September 12, 2016 1.6k views
Apache Control Panels Ubuntu

Hello. I'm needing some help here. Using Ubuntu 14.05 with Webmin installed to run the control panel side of things. When setting up a virtual host for websites, I point the domain A record at the server address, add a new virtual host. I can then view the website using chrome. I then add the second website pointing to its own folders. when I use a browser to view my second domain it redirects to the first domain. I don't know if this makes any sense? I am a slight newbie to this and would be grateful for a few pointers! Apologies if this has already been asked elsewhere

Thanks!

2 comments
2 Answers

I would recommend reviewing this tutorial which covers setting up Apache virtualhosts without webmin. You can use webmin to directly edit your configuration files. If you can share your current virutalhost configuration for the two domains I'd be happy to help you identify the problem.

The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 16.04 server.

Thanks for your speedy response! I have virtualhost config below:

<VirtualHost xxx.xx.xx.x>
DocumentRoot /var/www/html/capriequip
ServerName capriequipment.com
ServerAlias *.capriequipment.com
<Directory "/var/www/html/capriequip">
allow from all
Options None
Require all granted
</Directory>
</VirtualHost>
<VirtualHost xxx.xx.xx.x>
DocumentRoot "/var/www/html/alexlyon"
ServerName alexlyon.biz
ServerAlias *.alexlyon.biz
<Directory "/var/www/html/alexlyon">
allow from all
Options None
Require all granted
</Directory>
</VirtualHost>

I have changed the IP address...

The first domain is www.capriequipment.com and the second is www.alexlyon.biz. The second loads the first domain when viewed in a webpage

Thanks in advance!

Have another answer? Share your knowledge.