Apache Host Two Web Sites On Server With One IP Address

It can be done with the help of Name Based Virtual hosting.

ServerName 127.0.0.1
NameVirtualHost *:80

ServerName web1.test.com
DocumentRoot /var/www/html/web1

ServerName web2.test2.com
DocumentRoot /var/www/html/web2

Share

Leave a Reply

Your email address will not be published. Required fields are marked *