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: ReWriteRules on apache
Author
velocity



Joined: 14 Apr 2010
Posts: 21

PostPosted: Wed 26 May '10 13:04    Post subject: ReWriteRules on apache Reply with quote

I am finding a problem using mod_rewrite rules on apache.
Following is the ReWriteRule I am using

RewriteRule ^/(.*) http://127.0.0.1:8080/VirtualHostBase/http/<Server Name>:80/eduCommons/VirtualHostRoot/$1 [P,L]

but if some one is trying to access the site
then he gets a link like this

http://192.168.1.5:8080/eduCommons/acl_users/credentials_cookie_auth/require_login?came_from=http://192.168.1.5:8080/eduCommons/%40%40coursebuilderform

what should I look for?
Back to top
James Blond
Moderator


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

PostPosted: Mon 31 May '10 21:07    Post subject: Reply with quote

I wonder why there is two times a :PORT-NUMBER in your rewrite rule.
What are you trying to do?
Back to top
velocity



Joined: 14 Apr 2010
Posts: 21

PostPosted: Mon 14 Jun '10 8:41    Post subject: Reply with quote

Actually now I am able to solve the problem.
The Port Number is required.

I was able to solve this.

http://educommons.com/dev/browser/eduCommons-extras/trunk/eduCommons.conf.example.redhat

Here is a sample configuration
file.
In my case the Apache server and eduCommons were physically different also I did not had a Local DNS entry for internal server where eduCommons was present.
So on the front end Apache I needed to have in /etc/hosts
a line which tells
http://ocw.mydomain.com
is mapped to which IP on LAN internally.So that when you forward a request HTTP_HOST it does not start querying
DNS on internet.

The correct format on Server A is
Code:

ProxyPass   URL_B_Where_eduCommons_is:8080/VirtualHostBase/http/%{HTTP_HOST}:80/VirtualHostRoot/eduCommons
ProxyPassReverse   URL_B_Where_eduCommons_is:8080/http/%{HTTP_HOST}:80/VirtualHostRoot/eduCommons



Where HTTP_HOST is what the client on internet requested.
I did not had a local DNS entry to point HTTP_HOST to my URL_B where eduCommons is.
So in /etc/hosts
URL_B should be mapped to HTTP_HOST.
Then URL_B in proxy pass directive should not have IP address.
You can use HTTP_HOST also provided you mapped HTTP_HOST with URL_B_Where_eduCommons_is .
Do not include the port number to map.
Back to top


Reply to topic   Topic: ReWriteRules on apache View previous topic :: View next topic
Post new topic   Forum Index -> Apache