Virtual Hosts on Apache

# vi /etc/hosts

Add following lines:

127.0.0.1 www.address.com

127.0.0.1 www.smallco.com

:wq

# vi /etc/httpd/conf/httpd.conf

:/NameVirtualHost

Add following lines:

# www.address.com

NameVirtualHost localhost

<VirtualHost localhost>

ServerAdmin webmaster@www.address.com

DocumentRoot /home/httpd/address/html

ServerName www.address.com

ErrorLogs logs/error_log

CustomLog logs/access_log common

</VirtualHost>

# www.smallco.com

NameVirtualHost localhost

<VirtualHost localhost>

ServerAdmin webmaster@www.smallco.com

DocumentRoot /home/httpd/smallco/html

ServerName www.smallco.com

ErrorLogs logs/error_log

CustomLog logs/access_log common

</VirtualHost>

: /Bind

Change to “BindAddress localhost

:wq

Restart the computer.