logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: apache reverse proxy problem
Author
velocity



Joined: 14 Apr 2010
Posts: 21

PostPosted: Fri 16 Apr '10 19:36    Post subject: apache reverse proxy problem Reply with quote

Hi
I have a scenario.A domain www.mydomain.com
then there are 4 private computers on which applications are hosted at port 80.
So when some one from outside access the site it should look
as www.mydomain.com/site1
in apache2.conf where www.mydomain.com is hosted
I added
Code:

ProxyPass /site1 http://192.168.0.2
ProxyReversePass /site1 http://192.168.0.2

is it correct ?
I am able to see www.mydomain.com/site1
but when some one logs in from internet to www.mydomain.com/site1
it is redirecting to www.mydomain.com and not taking to page where a successful login will go
in www.mydomain.com/site1
what should I check or do ?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Sat 17 Apr '10 11:19    Post subject: Reply with quote

Is there any rewriting on the main server?
Back to top
velocity



Joined: 14 Apr 2010
Posts: 21

PostPosted: Sat 17 Apr '10 12:47    Post subject: Reply with quote

No none but to be sure how do I check it let me know what files you want to see I will post the required entries.

I have setup a proxy as above but there is no rewrite rule.
What is happening is if someone is trying to login
http://www.mydomain.com/site1
when he logs in he is redirected to http://www.mydomain.com/?q=node&destination=node
where as he should be redirected to http://www.mydomain.com/site1/?q=node&destination=node
How can I overcome this.
Back to top
velocity



Joined: 14 Apr 2010
Posts: 21

PostPosted: Sat 17 Apr '10 19:25    Post subject: Reply with quote

Hi yes you are right.Even then now I am posting a solution since by now I have solved the problem.
http://swik.net/MySQL/Planet+MySQL/Operating+a+Drupal+Site+behind+a+Reverse+Proxy+Server+(Apache)/dcslr

I am posting so that if some one else faces the same problem they may get a solution.Which is mentioned on the above link you can go there directly and read it.
Code:

When you install drupal on a server which is behind apache reverse proxy you need to tell that drupal installation about the presence of reverse proxy in your nework.
That is the core of the problem.
To achieve this you need to do do following
in your drupal installation folder go to sites/default/settings.php
and change the following

$base_url="http://www.mydomain.com/;
then
$cookie_domain = 'proxyserver.yourdomain.com';

if above both are same then place them same values
then
uncomment

$conf = array(

then
uncomment
'reverse_proxy' => TRUE,

then
'reverse_proxy_addresses' => array('192.168.0.1',),
replace it by IP of your apache reverse proxy

and uncomment below it
);

Hopefully it should work.
Keywords to search for this are if you are using drupal
"drupal behind apache reverse proxy"

You can get same problem if you do not use drupal the thing is any web server running behind a proxy needs to know how to handle requests which are forwarded by proxy.
Some one if comes across same situation do reply here make a blog etc it will help others.
Back to top


Reply to topic   Topic: apache reverse proxy problem View previous topic :: View next topic
Post new topic   Forum Index -> Apache