Apache : Name Based Virtual Hosts

The notable difference between IP-based and name-based virtual host configuration is the NameVirtualHost directive which specifies an IP address that should be used as a target for name-based virtual hosts.

For example, we use both http://www.abc.com and http://www.xyz.com at the IP address 192.168.0.1 We simply add to one of the Apache configuration files:

NameVirtualHost 192.168.0.1
192.168.0.1>
ServerName http://www.abc.com
DocumentRoot /www/abc

192.168.0.1>
ServerName http://www.xyz.com
DocumentRoot /www/xyz

Of course, to make this work, all that is needed is to make sure that the names http://www.abc.com and http://www.xyz.com are pointing to the IP address 192.168.0.1

More information can be found at www.apache.org

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: