How to Create an Apache Virtual Host in Webmin

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:

  1. Login to Webmin (usually http://[ip-or-hostname]:10000)
  2. Under “Servers” select “Apache Webserver”
  3. Click the third tab labeled “Create virtual host”
  4. Specify the IP address or choose “any” to share the default IP
  5. If necessary, specify the port for the site. Usually, the default port is sufficient
  6. Choose the document root where the files where be stored. An example might be /home/user/www
  7. Next to “Server Name” enter the hostname, usually a domain, for the site.
  8. If you have a separate virtual servers file you want to use, select it. Otherwise, leave the default httpd.conf option
  9. 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.