The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Apache mod_proxy +DNS slow response problem donaldfung IP Networking 2 05-23-2008 04:01 AM
How to force the LAN interface running on 10M Felixkoo SUN Solaris 3 01-23-2008 03:11 AM
Apache question moe2266 UNIX for Dummies Questions & Answers 1 08-17-2007 08:53 PM
hp-ux serial connection question piltrafa UNIX for Dummies Questions & Answers 2 01-04-2006 11:27 AM
force use of specific Perl library methos Shell Programming and Scripting 1 11-17-2005 08:40 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-02-2008
Halfwalker Halfwalker is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 3
Double question: Apache mod_proxy and force connection over specific interface

Double question here ... Running on Debian Etch and Apache 2.0

1) Using mod_proxy and/or mod_proxy_http in apache 2.0.

The basics of using mod_proxy are pretty simple so long as you're using a static config. I'm trying to figure out how to do it dynamically - that is, allow the entry of a url via a form and proxy THAT url ...

Code:
ProxyPass        /foo http://foo.example.com/bar
ProxyPassReverse /foo http://foo.example.com/bar
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
                      This needs to be entered via form
This would be a simple page that has a drop-down list to select the outgoing interface (see part 2) and box to enter a url. Clicking the button would fetch the url using the selected interface.

2) Force a mod_proxy outgoing connection to use a specific local interface (eth0:1, eth0:2 and so on) each with its own IP address/network.

The local box this would be on would have several IP addresses configured via aliases. The form selection would allow the redirection/proxy to go out over a specific interface/address. This would let us validate the traffic paths and let the target site customize the content to the incoming source IP address.

Any ideas as to where to look to figure this out ?

Thanks -

D.
  #2 (permalink)  
Old 01-06-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
Quote:
Originally Posted by Halfwalker View Post
2) Force a mod_proxy outgoing connection to use a specific local interface (eth0:1, eth0:2 and so on) each with its own IP address/network.

The local box this would be on would have several IP addresses configured via aliases. The form selection would allow the redirection/proxy to go out over a specific interface/address. This would let us validate the traffic paths and let the target site customize the content to the incoming source IP address.
If you create several virtual NICs as above, you can use destination specific routing to choose which interface to use. It's not quite what you've asked for but could be sufficient?
  #3 (permalink)  
Old 01-07-2008
Halfwalker Halfwalker is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 3
Quote:
Originally Posted by Smiling Dragon View Post
If you create several virtual NICs as above, you can use destination specific routing to choose which interface to use. It's not quite what you've asked for but could be sufficient?
Thanks, but that won't work The problem is that the remote URL can be anything, so you can't have any specific source routing in place.

I wonder if using wget or something which allows specification of the local IP address could come into play ? Since we know the local IP to use (from the form) we can craft a command-line wget to go grab the URL.

Hrm, how then to pass it back up the chain to the original requesting client browser ?

D.
  #4 (permalink)  
Old 01-07-2008
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,230
Your discription of what you want is not really very clear, but from what I understand of it.

Create N virtual hosts in Apache, each running on a specific ipaddress. Use mod_proxy + mod_rewrite with [P] directives on each to give you the dynamic proxying. Configure mod_proxy and mod_rewrite to proxy the primary webpage to the secondary proxy on the virtual hosts, via a base directory for each one.
  #5 (permalink)  
Old 01-08-2008
Halfwalker Halfwalker is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 3
Quote:
Originally Posted by reborg View Post
Your discription of what you want is not really very clear, but from what I understand of it.

Create N virtual hosts in Apache, each running on a specific ipaddress. Use mod_proxy + mod_rewrite with [P] directives on each to give you the dynamic proxying.
Could you give an example ? As far as I can tell, mod_proxy uses static config lines - how do you make that dynamic based on what the client browser enters in the URL field of the base page ? See below ...

Quote:
Originally Posted by reborg View Post
Configure mod_proxy and mod_rewrite to proxy the primary webpage to the secondary proxy on the virtual hosts, via a base directory for each one.
Secondary proxy ?

Let's say we have a really simple system set up, with 3 IP addresses :

eth0:1 is 10.0.1.1
eth0:2 is 10.0.2.1
eth0:3 is 10.0.3.1

I want a very simple basic page, with a pulldown list of the 3 IP addresses/interfaces, and an entry box to enter in a URL. The client browser selects eth0:1/10.0.1.1 and enters http://www.mydomain.com/testing into the entry field (could be any URL - that's key).

Apache then fetches http://www.mydomain.com/testing using 10.0.1.1 as the source IP address and presents back up to the client browser. mydomain.com thinks that the browser is actually coming from 10.0.1.1.

D.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:56 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0