Solved

Redirect to secondary private network server

Posted on 2009-05-12
4
563 Views
Last Modified: 2012-05-06
Okay, here's the situation. I have a publicly accessible static IP address that currently has port 80 forwarded from the firewall/router to an internal private web server (i.e. 192.168.0.3) that is handling several websites via Virtual Hosts. This works like a charm without any issues.

I am in the progress on building a 2nd internal web server (i.e. 192.168.0.12) that will house only one 'testing' web instance. Since port 80 is already forwarded on the firewall to the primary web server, I would like to keep the virtual host on the primary web server, but redirect (proxy) all inbound http connectivity for this other domain name to the 2nd internal web server after seeing the entry on the primary web server.

Internet --> Firewall/Port Forward (Forward Port 80) --> Primary Web Server (Listen Port 80) --> mod_proxy --> 2nd Internal Web Server (Listen Port 80)

What do I need to do on the primary web server's Virtual Host entry to redirect all traffic to the 2nd web server while maintaining the domain name in the URL (i.e. not showing the user the site is being redirected)?

I thought of something like this, but I don't know if that would really work or not...

<VirtualHost *:80>
  ServerName myothersite.com
  ServerAlias www.myothersite.com
  ProxyRequests Off
  ProxyPreserveHost On
  ProxyPass / http://192.168.0.12/
  ProxyPassReverse / http://192.168.0.12/
</VirtualHost>

Open in new window

0
Comment
Question by:Michael Worsham
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
ID: 24370845
Hi,

Just try this:
<VirtualHost *:80>
  ServerName myothersite.com
  ServerAlias www.myothersite.com
  ProxyRequests Off
  ProxyPreserveHost On
  ProxyPass / http://192.168.0.12/
  ProxyPassReverse / http://192.168.0.12/
  DocumentRoot /usr/local/apache2/htdocs 
  Errorlog logs/www.myothersite.com.log
  CustomLog logs/www.myothersite.com.access_log combined	
</VirtualHost>

Open in new window

0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24371047
I'm using a similar setup and it works like charm : ) I'm sure it will work for you too.
0
 
LVL 29

Author Closing Comment

by:Michael Worsham
ID: 31580805
Yep. Worked like a charm. Thanks!
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24372293
Yr welcome :)
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VPN 101 - how and which protocol? 9 121
Slow Network 51 90
Generic Rule to Redirect and Rewrite URL using .htaccess 8 86
Joining Domain Issue 4 55
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question