Apache Virtual Hosts

August 7, 2007 – 4:25 pm

 Tip courtesy of Kyle Reynolds at http://www.camelrichard.org

in httpd.conf:

### Section 3: Virtual Hosts

#
# Use name-based virtual hosting.
#

NameVirtualHost 192.168.1.122
Listen 192.168.1.122:80

#
# VirtualHost example:
#


ServerName www.domain1.org
DocumentRoot /usr/local/apache2/domain1.org/htdocs
ServerAdmin admin@domain1.org
ErrorLog logs/domain1.error_log
CustomLog logs/domain1.access_log combined


ServerName www.domain2.net
DocumentRoot /usr/local/apache2/domain2.net/htdocs
ServerAdmin admin@domain2.net
ErrorLog logs/domain2.error_log
CustomLog logs/domain2.access_log combined

Post a Comment