Apache HTTP Server can run in a single instance, one host per server, or as multiple virtual hosts, allowing you to have several websites. Manually setting up virtual hosts can be a bit of a pain, and paying for a commercial control panel may not be in your budget. With the free and open source Webmin control panel, however, you can easily create virtual hosts for Apache.
To create a virtual host, follow these steps:
- Login to Webmin (usually http://[ip-or-hostname]:10000)
- Under “Servers” select “Apache Webserver”
- Click the third tab labeled “Create virtual host”
- Specify the IP address or choose “any” to share the default IP
- If necessary, specify the port for the site. Usually, the default port is sufficient
- Choose the document root where the files where be stored. An example might be /home/user/www
- Next to “Server Name” enter the hostname, usually a domain, for the site.
- If you have a separate virtual servers file you want to use, select it. Otherwise, leave the default httpd.conf option
- Click “Create Now”
If all goes well, you will have created a virtual host that should be accessible from the web. Once the virtual server has been created, you will be able to click on it and edit any further options related to it, such as users, aliases, redirects, and PHP.