views:

413

answers:

2

My Apache 2.2.9 runs on Debian Lenny 5.0.1 with 2 network interfaces, one interface has a public IP and hostname, the other is not configured. This machine caters to services that run on the LAMP stack.

There is a Windows Server 2008 SP2 machine running IIS 7 that serves our ASP.net needs. The box can be configured to be either on a local or a public IP and has 2 network interfaces as well.

Both the servers serve over SSL and Apache is public facing.

Is there a way when a request such as https://foo.com/contentfromiis/ is made the browser can serve contents from the IIS server without using a redirect and transferring to https://bar.com/iwastransferedhere/. In other words the user must not /experience/ any switch happening. Thanks!

+2  A: 

If I understand your situation correctly, I believe you may be able to use mod_proxy to do what you want. Basically, Apache would act as a "reverse proxy" for the requests that you actually want to serve from IIS. Note that a reverse proxy isn't like a normal HTTP proxy. From the mod_proxy docs:

A reverse proxy ... appears to the client just like an ordinary web server. No special configuration on the client is necessary. The client makes ordinary requests for content in the name-space of the reverse proxy. The reverse proxy then decides where to send those requests, and returns the content as if it was itself the origin.

Laurence Gonsalves
Thanks Laurence, that addresses my problem.
t3
A: 

Yes, what Laurence Gonsalves says. Here is a simple as simple can be configuration file that I've taken from a caching reverse proxy server of mine. You should be able to work in some URL matching but I've not done that myself.

# httpd *reverse proxy caching server* config file for apache httpd 2.2
ServerRoot "C:/Program Files/Apache Group/Apache2"
#must exist, no reason to have anythign in it    
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"

Listen 127.0.0.1:80
Listen 192.168.1.33:80
ServerAdmin [email protected]
ServerName proxy.server.com

LoadModule auth_module modules/mod_auth.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

### PROXY CONFIGURATION  ###
ProxyRequests Off
ProxyVia On

### VH ###
<VirtualHost 192.168.1.33>
    ProxyPass        /  http://192.168.1.34:80/
    ProxyPassReverse /  http://192.168.1.34:80/
    LogLevel info
</VirtualHost>

### LOGGING CONFIGURATION ###
# error log will not catch proxied content
ErrorLog logs/error.log
LogLevel info
LogFormat "%{Host}i %v %h %l %u %t \"%r\" %>s %b  common
CustomLog logs/access.log common
TypesConfig conf/mime.types
Stu Thompson
Thanks Stu, your config file will be handy as I tweak that to my environment.
t3