For the purposes of this post, we will make the following assumptions:
- You are only running one installation of Apache on one installation of Linux (Ubuntu Server 12.01 used here).
- Your server only has one public IP address.
- You have two domains which are configured to both point to your server’s public IP address.
- You have already installed Webmin like I told you to in this post.
Let’s say you have a couple of domains, domain1.com and domain2.com. You want to do the web hosting from the same server. What you’ll need to do is create a couple of virtual servers.
Log in to Webmin (https://<YOUR_SERVER_IP>:10000).
On the side bar, open up the Servers section and click on Apache Webserver.
You should see two items in the list under the tab “Existing virtual hosts”. Leave both of those alone, and click on the tab labeled “Create virtual host”.
The only things you need to change are the server name and the document root. Make sure you have created a directory where you will hosting your website out of, other than /var/www. For example, /var/www/domain1. Set that as your document root. Set your server name as your domain name, for example, domain1.com. Then, click on the button that says “Create Now”.
Repeat this process for the other domain, using a different server name and document root.
Put a different index.html in each document root, to verify by visiting the different domains, that you are accessing different content.
Because you still have a virtual server configured without a server name, any attempt to access a website using only an IP address can be handled differently than if the domain names.
And that’s it! You now have two websites being served from the same server/IP address.
Here is some more advanced info.