0

I am trying to add two virtual hosts to apache.

In httpd.conf i uncomment these lines:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_module modules/mod_proxy_connect.so
Include conf/extra/httpd-vhosts.conf

And i add these to httpd-vhosts.conf;

<Directory "C:/dev/cfusion">
    Order allow,deny
    Allow from all
</Directory>

NameVirtualHost *:80

<virtualhost *:80>  
    DocumentRoot "C:\dev\cfusion"
    ServerName cfusion
    ProxyRequests Off  
<proxy *>  
    Order deny,allow  
    Allow from all  
</Proxy>  
    ProxyPass / http://127.0.0.1:8080/cfusion/  
    ProxyPassReverse / http://127.0.0.1:8080/cfusion/  
    ErrorLog "logs/cfusion.local-error.log"
    CustomLog "logs/cfusion.local-access.log" common
</VirtualHost>

<virtualhost *:80>  
    DocumentRoot "C:\dev\cfusion"
    ServerName railo
    ProxyRequests Off  
<proxy *>  
    Order deny,allow  
    Allow from all  
</Proxy>  
    ProxyPass / http://127.0.0.1:8080/railo/  
    ProxyPassReverse / http://127.0.0.1:8080/railo/  
    ErrorLog "logs/railo.local-error.log"
    CustomLog "logs/railo.local-access.log" common
</VirtualHost>

When i comment the Include, i see the default apache site, otherwise i get an 500 internal server error. Whats the problem?

When i un-comment

ProxyPass / http://127.0.0.1:8080/railo/

then i dont get the 500 error anymore, but the proxying does not work :(

mrt181
  • 171
  • 1
  • 10

4 Answers4

3

While probably not the source of your problem, this looks like an error:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_module modules/mod_proxy_connect.so
Include conf/extra/httpd-vhosts.conf

That second line should be:

LoadModule proxy_connect_module modules/mod_proxy_connect.so
larsks
  • 43,623
  • 14
  • 121
  • 180
0

Maybe it's because of the xml tags, which begin lowercase and end in uppercase.

i.e. <proxy *> ... </Proxy>

I have no Apache here to test, but give it a try

Scoregraphic
  • 524
  • 6
  • 9
0

Some things you can try:

  1. Don't use the DocumentRoot directive, you don't need it for vhosts using proxy.
  2. Remove <proxy *> ... </proxy> directives. This is not used for reverse proxy.
  3. Define a ServerAlias directive and a ProxyTimeout
  4. Put the ProxyRequests before ProxyPass and ProxyPassReverse

Hope it works.

Jr. Hames
  • 83
  • 8
0

Ok, i have found the error. All i had to do is un-comment the proxy submodule:

LoadModule proxy_http_module modules/mod_proxy_http.so
mrt181
  • 171
  • 1
  • 10