Home Miscellaneous Configuring Virtual Host Using Webmin Control Panel

Configuring Virtual Host Using Webmin Control Panel

by Bella

The term virtual host refers to running two different sites on the same machine. This allows one server to share the same resources to multiple sites. There are two types of virtual hosting-name based and IP-based. Name-based hosts use multiple hostnames for the same IP address. The main issue with name-based virtual hosting is that it is difficult to host multiple websites running under secure SSL/TLS protocol. Also if DNS is not functioning, there will be some difficulties to access virtually hosted website even if the IP address is known, as the server responds with the default website.
To activate name-based virtual hosts, a directive. NameVirtualHost *. * is sufficient to prompt Apache to accept all incoming requests. Apache uses the host field in the HTTP header to connect the request to the virtual host. Then the request is forwarded to the virtual host whose server name matches with the hostname field.
In IP-based virtual hosting each site point to a unique IP address. In this case, one instance of Apache hosts several domains, each of which is assigned a different IP. IP-based virtual hosts use the IP address of the connection to determine the correct virtual host to serve. In order for Apache to host multiple IPs, IP aliasing must be activated in the kernel. The disadvantage of ip-based hosting is that it contributes to IPv4 address exhaustion as each website needs a unique IP address.


Example of name based virtual host

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@example.com
DocumentRoot /www/docs/example.com
ServerName test.example.com
ErrorLog /www/logs/example.com-error_log
TransferLog /www/logs/example.com-access_log
</VirtualHost>

Example of IP-based virtual host

<VirtualHost **.**.**.**>
ServerAdmin webmaster@example.com
DocumentRoot /www/docs/example.com
ServerName example.com
ErrorLog /www/logs/example.com-error_log
TransferLog /www/logs/example.com-access_log
</VirtualHost>

Webmin is a free, powerful web-based interface for system administration. It is a popular alternative to administration panels such as cpanel/plesk. The advantage of webmin is that it is built on a modular design,that means a module can be installed or uninstalled independent of the rest of the applications. The main disadvantage of webmin as compared to cpanel which acts as a server is that, it can be used only as a configuration tool and it depends on other applications to perform.

Now we can go through the steps in creating a virtual host using webmin
1. Access the webmin control panel using http://IP:10000
2. Create the folder where the site files need to be stored.

* You can create a folder clicking Others > File Manager section in webmin
* For eg:/www/docs

3. Setting up virtual host

* Access the webmin control panel using http:IP:10000
* Click on Servers —-> Apache webserver
* Click on ‘create virtual host’ tab
* Default settings can be used for most of the values
Port : Enter port 80
Document root : This is where site files are stored.use for eg : /www/docs
Server name : select domain name(eg : www.example.com)
* Click create now.

4. How to add a Server alias for domain www.example.com

 

* Click on Servers > Apache Web Server > Existing Virtual Hosts
* Click on the virtual server created
* Add any other server aliases to use in ‘Alternate Virtual Server Names’ box
eg:www.example.com

* Click Save

5. Click on ‘Apply changes’. This will save the configuration and restart Apache.

If you require help, contact SupportPRO Server Admin

Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value

Leave a Comment

CONTACT US

Sales and Support

Phone: 1-(847) 607-6123
Fax: 1-(847)-620-0626
Sales: sales@supportpro.com
Support: clients@supportpro.com
Skype ID: sales_supportpro

Postal Address

1020 Milwaukee Ave, #245,
Deerfield, IL-60015
USA

©2022  SupportPRO.com. All Rights Reserved