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: mode rewrite beginner problem
Author
velocity



Joined: 14 Apr 2010
Posts: 21

PostPosted: Fri 16 Apr '10 14:17    Post subject: mode rewrite beginner problem Reply with quote

I am not aware of mod rewrite I have never done it so no idea as how it should be done.Syntax etc I searched and came across a lot of things a file named .htaccess is coming
I have five .htaccess files for each of the five different domains but how do I go for the?
Give me some idea for this.

Drupal has been installed on 5 places.


On our gateway which is
http://www.myserver.com
then the four different virtual hosts which are not same as Apache virtual hosts.They are 4 Guest Operating systems which are isolated from each other.All of them are Debian.


They all have installations of Apache on them.
That is if you do an ssh to site1 you will see drupal files there
similarly if you do an ssh to site2 or site3 or site4 you will see drupal files there.
Each of them has settings.php for them,
There is also a Drupal instance running on our gateway http://www.myserver.com

Imagine as four different computers on your LAN which are behind a gateway.

http://www.myserver.com/site1 is run on a different computer which is different than where http://www.myserver.com is.
Similarly
http://www.myserver.com/sitet2
http://www.myserver.com/site3
http://www.myserver.com/site4

are on different hosts.
When I try to login
from
http://www.myserver.com/site1
it gives an error
Code:

Sorry, unrecognized username or password with a url
http://www.myserver.com/?q=node&destination=node

I do not see the word /site1 in the above URL which is where I had logged in.


I infer that this error message is coming from http://www.myserver.com
and not http://www.myserver.com/site1




but if the same password is given from http://192.168.0.13 then it accepts it.Which is our internal IP of where /site1 is hosted.
So that means database is accessible to /site1 .
I searched and came across some thing as mod re write.
Is this the way to go in this scenario if yes then how should I go for it?/
Back to top
James Blond
Moderator


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

PostPosted: Fri 16 Apr '10 17:08    Post subject: Reply with quote

Maybe the thing you search for is a loadbalancer? Than you can login and don't have that issue with the login. I wonder why you split up the server into virtual servers and than combine them that stange. What's you strategie?
Back to top
velocity



Joined: 14 Apr 2010
Posts: 21

PostPosted: Sat 17 Apr '10 19:26    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: mode rewrite beginner problem View previous topic :: View next topic
Post new topic   Forum Index -> Apache