Setting up Apache with multiple virtual host when using Plone 4.1
- by Shaun Owens
I have a Plone server running on CentOS, I have multiple instances of Plone running 4.0 and 4.1, I also have multiple sites. I am new to linux and haveing problems getting Apache to work with multiple virtuale hosts. The first host listed works just fine but the second host does not. I get the following error message when I start HTTPD:
Starting httpd: [Mon Nov 07 14:38:31 2011] [warn] VirtualHost ordevel3.ucdavis.edu:80 overlaps with VirtualHost ordevel4.ucdavis.edu:80,
the first has precedence, perhaps you need a NameVirtualHost directive.
What am I missing to get the virtual hosts to work correctly?
Below in my syntax in httpd.conf.
<VirtualHost ordevel3.abc.edu:80>
ServerAlias ordevel3.abc.edu
ServerAdmin [email protected]
ServerSignature On
<IfModule mod_rewrite.c>
RewriteEngine On
# serving icons from apache 2 server
RewriteRule ^/icons/ - [L]
RewriteRule ^/(.*) \
http://localhost:8080/VirtualHostBase/http/%{SERVER_NAME}:80/itsdevel3/VirtualHostRoot/$1 [L,P]
</IfModule>
<IfModule mod_proxy.c>
ProxyVia On
# prevent the webserver from beeing used as proxy
<LocationMatch "^[^/]">
Deny from all
</LocationMatch>
</IfModule>
</VirtualHost>
<VirtualHost ordevel4.abc.edu:80>
ServerAlias ordevel4.abc.edu
ServerAdmin [email protected]
ServerSignature On
<IfModule mod_rewrite.c>
RewriteEngine On
# serving icons from apache 2 server
RewriteRule ^/icons/ - [L]
RewriteRule ^/(.*) \
http://localhost:8180/VirtualHostBase/http/%{SERVER_NAME}:80/ITS/VirtualHostRoot/$1 [L,P]
</IfModule>
<IfModule mod_proxy.c>
ProxyVia On
# prevent the webserver from beeing used as proxy
<LocationMatch "^[^/]">
Deny from all
</LocationMatch>
</IfModule>
</VirtualHost>