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 > Special Forums > Web Programming, Web 2.0 and Mashups
.
google unix.com



Web Programming, Web 2.0 and Mashups Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, Flash, HTML, SEO, Mashups and other Web APIs and topics.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Software/tool to route an IP packet to proxy server and capture the Proxy reply as an Rajesh_BK IP Networking 0 02-19-2009 02:32 AM
reverse proxy add forward 0.6 (Default branch) iBot Software Releases - RSS News 0 01-02-2008 04:50 AM
squid proxy and apache servers marcpascual UNIX for Advanced & Expert Users 0 10-04-2005 03:26 AM
Apache httpd.conf <VirtualHost> issue Spetnik UNIX for Dummies Questions & Answers 5 07-01-2003 01:35 PM
.forward MsGail UNIX for Dummies Questions & Answers 3 03-08-2001 10:21 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-29-2009
krunksta krunksta is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 3
Apache: Forward Proxy Via Virtualhost

I've set up a forward proxy within a VirtualHost (see below) on Apache 2.2.11. I then browse using mydomain.com:80 as the proxy - I've also tried using the IP address of the VirtualHost xxx.xxx.xxx.xxx:80. It works fine, the only problem is that in both cases the server's main IP address is always displayed at the other end. Is there a way to make it so that the individual IP of the VirtualHost is shown instead?

I've tested the proxy via other VirtualHosts on the server and it doesn't work, so I know that it's being properly channelled through this one.

Code:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80>
   ServerName mydomain.com
   DocumentRoot /xxx/xxx/public_html
   ServerAdmin xxx@xxx.com
   ProxyRequests On
   ProxyVia On
   <Proxy *>
      Order deny,allow
      Allow from xxx.xxx.xxx.xxx
   </Proxy>
</VirtualHost>
  #2 (permalink)  
Old 07-29-2009
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,209
You should use the ProxyPass and ProxyPassReverse directives to get this working rather than the Proxy directive.

mod_proxy - Apache HTTP Server
  #3 (permalink)  
Old 07-29-2009
krunksta krunksta is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 3
Thanks for the reply, I tried your suggestion (see below). This produces a mirror of the external site (at http://mysite.com/mirror/), but the main IP of the server (instead of the VirtualHost IP) is still showing at the other end - I'm talking about the REMOTE_ADDR environment variable. I want it to be the individual IP address of the VirtualHost instead of the server's main/global IP.

Code:
NameVirtualHost xxx.xxx.xxx.xxx:80
<VirtualHost xxx.xxx.xxx.xxx:80> # I want this IP address to show as the REMOTE_ADDR
   ServerName mydomain.com
   DocumentRoot /xxx/xxx/public_html
   ServerAdmin xxx@xxx.com
   ProxyPass /mirror/ http://externalsite.com/
   ProxyPassReverse /mirror/ http://externalsite.com/
   <Proxy *>
      Order deny,allow
      Allow from xxx.xxx.xxx.xxx
   </Proxy>
</VirtualHost>

Last edited by krunksta; 07-29-2009 at 11:04 PM..
Reply

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 01:34 AM.


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