+1

Reverse Proxy In Ubuntu

Flex, CFML, Adobe, ColdFusion, Microsoft, Linux

The last few days I have spend some time setting up 2 new servers. One running Railo on Ubuntu and the other Coldfusion in Windows. I needed to host this on a single IP address and needed both machines available on the internet. There are 2 ways I know of that can accomplish this task 1. Using Microsoft ISA and 2 Using Apache as a reverse proxy. As I already have Apache up and running I went with option 2. While a seemingly trivial task I had never done this before and got hung up a few times the following are the steps I took: Define the urls you want to re-direct to a different server:

<VirtualHost *:80>
    ServerName www.myExternalDoomianName.com
    ProxyPass / http://myInternalDnsName/    ( or ip address )
    ProxyPassReverse / http:// myInternalDnsName /  (or ip address )
    ProxyPreserveHost on
</VirtualHost>


ProxyPreserveHost keeps the host headers intact so the internal sever can still use virtual websites.
Then run:

a2ensite myReverseProxySites

Need some extra bits for apache.

apt-get install libapache2-mod-proxy-html
a2enmod proxy
a2enmod proxy_html
a2enmod headers
a2enmod proxy_connect
a2enmod proxy_balancer

Restart apache

/etc/init.d/apache2 restart

If something isn’t working start looking in the logs:

tail -f  /var/log/apache2/error.log

Henry Ho said:
 
Would the CF Server see the IP of the actual request, or the remote proxy?
 
posted 159 days ago
View Replies (4) || Add Comment Reply to: this comment OR this thread
 
.: HIDE REPLIES :.
 
CF sees the address of the remote proxy. I do not believe it is possible to pass through the originating IP address.
 
posted 159 days ago
Add Comment Reply to: this comment OR this thread
 
Henry Ho said:
 
Thanks.

I'd imagine Session still works right? 'cause it is based on Cookie instead of IP? (as long as I'm pointing them to the same CF server)
 
posted 159 days ago
Add Comment Reply to: this comment OR this thread
 
 
Yes. I put one of our larger apps behind the proxy and have had no issues with sessions. Also note that all Flex/Flash remoting and Dreamweaver and Eclipse RDS works perfectly via the proxy.
 
posted 159 days ago
Add Comment Reply to: this comment OR this thread
 
Henry Ho said:
 
Wonderful! I'm thinking of setting up something similar. Nice to hear things worked out for you.
 
posted 159 days ago
Add Comment Reply to: this comment OR this thread
 
 
Henry I was mistaken earlier its possible to get the original ip information as Sean pointed out here: http://corfield.org/blog/index.cfm/do/blog.entry/e... good stuff!
 
posted 97 days ago
Add Comment Reply to: this comment OR this thread
 

Search