Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 :(

share|improve this question
    
You're getting a 500 error? Well, what does your error log say? –  larsks Dec 14 '09 at 14:24
add comment

4 Answers 4

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
share|improve this answer
    
yes i have incorrectly added a wrong line but my httpd.conf is fine. –  mrt181 Dec 14 '09 at 14:57
    
Don't forget to accept this answer if it has solved your problem. –  Andrejs Cainikovs Dec 14 '09 at 16:45
add comment

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

share|improve this answer
    
does not change anything –  mrt181 Dec 14 '09 at 14:58
add comment

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.

share|improve this answer
    
Your suggestions do not help –  mrt181 Dec 14 '09 at 16:11
    
Have you tried to set the LogLevel to debug to see what is happening? –  Jr. Hames Dec 14 '09 at 17:17
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.