Apache Virtual Host Setup

Apache Virtual Host makes one web server hosts more than one web service virtually.

Add this line at the end of the httpd.conf: (in /etc/httpd/conf/)
NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /var/www/html/example1
    ServerName example1.com
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /var/www/html/example2
    ServerName example2.com
</VirtualHost>
Don't forget to restart the apache server.
sudo service httpd restart

No comments:

Post a Comment