LoganTeamX
IS-IT--Management
I just fought with a lot of fuzzy documentation and older recountings of configuring multiple vhosts on a single Apache box. I figured out how to get it running with 2.2.2 and thought I'd share the wealth
The info shown below goes in your Extra/httpd-vhosts.conf file, and it likely replaces what's there by default.
<VirtualHost *:80>
ServerAdmin admin@domain.com
DocumentRoot /Websites/domain
ServerName ServerAlias *.domain.com
ErrorLog logs/domain.com-error_log
CustomLog logs/domain.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@domain.com
DocumentRoot /Websites/domain2
ServerName ServerAlias *.domain2.com
<Directory "c:/websites/domain2">
Allow from all
</Directory>
ErrorLog logs/domain2.com-error_log
CustomLog logs/domain2.com-access_log common
</VirtualHost>
It's important to note the Directory routine within the second VirtualHost. Before doing that entry, I would get a 403 Forbidden all the time on my additional vhost as the default allow permission in HTTPD.conf doesn't carry over to vhosts. After checking the HTTPD.conf and earlier solutions here... I decided to play and the result was exactly what I needed.
I hope that the info above can be of some assistance to others in my place.
Cheers!
The info shown below goes in your Extra/httpd-vhosts.conf file, and it likely replaces what's there by default.
<VirtualHost *:80>
ServerAdmin admin@domain.com
DocumentRoot /Websites/domain
ServerName ServerAlias *.domain.com
ErrorLog logs/domain.com-error_log
CustomLog logs/domain.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@domain.com
DocumentRoot /Websites/domain2
ServerName ServerAlias *.domain2.com
<Directory "c:/websites/domain2">
Allow from all
</Directory>
ErrorLog logs/domain2.com-error_log
CustomLog logs/domain2.com-access_log common
</VirtualHost>
It's important to note the Directory routine within the second VirtualHost. Before doing that entry, I would get a 403 Forbidden all the time on my additional vhost as the default allow permission in HTTPD.conf doesn't carry over to vhosts. After checking the HTTPD.conf and earlier solutions here... I decided to play and the result was exactly what I needed.
I hope that the info above can be of some assistance to others in my place.
Cheers!