Fedora Linux Support Community & Resources Center
  #1  
Old 23rd February 2005, 03:32 PM
charles Offline
Registered User
 
Join Date: Jul 2004
Posts: 2
RewriteRule

Hi
I’m having two fc2 servers running apache 2.0. The first one have a public IP (web1), the second one (web2) don’t, its used as a xtranet.
What im trying to do is, by pushing a link on a website on web1, i want to redirect the call to web2 on which I have phproject installed. The following RewriteRule in httpd.conf will get me to the login page on phproject but as soon as I try to logon it fails, it cant read subdirs..

RewriteRule ^(.*) httpd://192.168.1.65/phproject/$1 [P]

Any ideas ?
Reply With Quote
  #2  
Old 23rd February 2005, 04:26 PM
spiderhosts Offline
Registered User
 
Join Date: Feb 2005
Posts: 102
May I recommend a different approach?

Why don't you redirect a port from the machine with a public IP to the machine on your intranet?

If you create the redirection on port 2222 for example you will be able to connect to web2 by typing the following:
http://your_ip_address:2222

I believe this approach is more flexible than a standard rewrite rule.

Let me know what you think

Bechara Hitti
__________________
SpiderHosts.com LLC
www.spiderhosts.com
www.spiderhosts.net

Last edited by spiderhosts; 23rd February 2005 at 04:36 PM.
Reply With Quote
  #3  
Old 24th February 2005, 09:11 AM
charles Offline
Registered User
 
Join Date: Jul 2004
Posts: 2
Hi Spiderhosts

Thanks for answering, so what you suggest is to use iptables to port forward incoming httpd packets on port xxxx to web2 ? ill try that and see how it works out.
Reply With Quote
  #4  
Old 24th February 2005, 09:53 AM
spiderhosts Offline
Registered User
 
Join Date: Feb 2005
Posts: 102
A very quick hack for this is to use SSH port redirection using the -R switch.

Code:
-R listen-port:host:port    (Forward remote port to local address)
taken from $ man SSH
This will help you test that everything is running smoothly before having to change the IP tables settings.

The same hack above allows you to provide a live port forwarding for any machine located behind a firewall provided that you have an SSH account on the machine with the live IP.

Please let me know if you have more questions.

Bechara Hitti
__________________
SpiderHosts.com LLC
www.spiderhosts.com
www.spiderhosts.net

Last edited by spiderhosts; 24th February 2005 at 09:57 AM.
Reply With Quote
Reply

Tags
rewriterule

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
rewriterule in htaccess carlman001 Servers & Networking 1 15th April 2008 02:33 PM
Apache...Rewriterule nitinvirgo079 Servers & Networking 2 13th May 2006 08:38 AM


Current GMT-time: 09:37 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat