APACHE ALIAS-1

SERVER ALIAS

 

<SERVER>

1) Go to configuration file, and add below line in VH (Virtual Host) below “ServerName” directive.

# vim /etc/httpd/conf/httpd.conf

<VirtualHost 192.168.0.102:80>

                   ServerAdmin webmaster@dummy-host.example.com

                   DocumentRoot /opt/website_directory1

                   ServerName first.com

                   ServerAlias second.com

                   DirectoryIndex index.php

                   ErrorLog logs/dummy-host.example.com-error_log

                   CustomLog logs/dummy-host.example.com-access_log common

</VirtualHost>

 

2) /etc/init.d.httpd reload

 

<CLIENT>

1) Make entry in “/etc/hosts”

#vim /etc/hosts

<Server-IP> <Server_Alias-Name>

:wq

 

2) Open browser and access website with “Server Alias” name

http://second.com

 


Comments