Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: redirect to other apache services |
|
Author |
|
thierry.beeckmans
Joined: 17 Jul 2007 Posts: 2
|
Posted: Tue 17 Jul '07 17:01 Post subject: redirect to other apache services |
|
|
I'm having difficulties while trying to redirect, depending on the url, to another apache service.
Following url's pct.be.sub, it-portal.be.sub all goes to http://192.109.60.81:80.
The apache service (on port 80) should, in case of pct.be.sub, go to another apache service (http://192.109.60.81:8081) which is configured with a php-module and another DocumentRoot.
Offcourse it-portal.be.sub corresponds to http://192.109.60.81:8082.
httpd-vhosts.conf contains: Code: | NameVirtualHost *:80
<VirtualHost *:80/>
ServerName pct.be.sub
ErrorLog logs/pct.be.sub.log
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8081/
ProxyPassReverse / http://localhost:8081/
</VirtualHost> |
I tried a whole day, but without the desired result.
All I get on pct.be.sub is "It works!" from the apache htdocs on port 80.
Thx in advance for any help |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 17 Jul '07 17:31 Post subject: |
|
|
Theoretic it should work. I used this on a vhost from me, but I had some mod_proxy_html stuff in it which I removed. Maybe you need the html trasforming, too. Depends on the html on the other server.
Code: |
<VirtualHost *:80>
ServerName pct.be.sub
ServerAlias www.pct.be.sub
ErrorLog /server2/logs/pct.be.sub .error.log
CustomLog /server2/logs/pct.be.sub .access.log common
ProxyPass / http://localhost:8081/
ProxyPassReverse / http://localhost:8081/
<Location />
ProxyPassReverse /
</Location>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
|
|
|
Back to top |
|
thierry.beeckmans
Joined: 17 Jul 2007 Posts: 2
|
Posted: Wed 18 Jul '07 9:13 Post subject: great :) |
|
|
I tried your code and it works!
Now I can try if my app still reacts like it should. I'm a newbie with vhosts, so I keep my fingers crossed.
Thx a lot Mr James Blond |
|
Back to top |
|
|
|
|
|
|