apache tutorial - IP-based Virtual host in apache - apache - apache web server - apache server - apache2



  • In order to setup IP based virtual hosting, you need more than one IP address configured on your server. So, the number of vhost apache will depend onnumber of IP address configured on your server. If your server has 10 IP addresses, you can create 10 IP based virtual hosts.
  • In the above diagram two websites example1.com and example2.com were assigned different IPs and are using IP-based virtual hosting.
[Listen 192.168.0.100:80

<VirtualHost 192.168.10.108:80>

ServerAdmin webmaster@example1.com

DocumentRoot /var/www/html/example1.com      

ServerName www.example1.com

</VirtualHost>

<VirtualHost 192.168.10.109:80>

ServerAdmin admin@example2.com

DocumentRoot /var/www/html/example2.com

ServerName www.example2.com

</VirtualHost>
click below button to copy the code. By Apache tutorial team

Related Searches to IP based virtual host in apache