Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 08-13-2008, 08:05 AM   #1
LQ Newbie
Registered: Aug 2008
Posts: 26

Rep: Reputation: 15
Two web servers / One static IP

I just recently tried to set up a second apache web server behind a static ip address. I thought it would be as simple as setting up port forwarding through my router (using 8080) and then having the new web server listen on port 8080. But apparently not.

Looking for clues I turned to google but surprisingly did not find an answer to this. Is there some reason you cannot host two web servers in this manner?

I did find reference to modprobe and setting up a reverse proxy. That looks really cool and I'd like to try that some day. But that's yet another project on a very long project list.

Thanks for the help!
Old 08-13-2008, 10:43 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 256Reputation: 256Reputation: 256
This is how I did it once where I had one public static IP with two servers behind the router using private IP's. Setup one of the web servers as a main webserver listening on port 80 (default). Then setup the second one just like the main one with the default port 80 and on the main webserver that you have port 80 forwarding to, do something like this:

<VirtualHost *:80>
        RewriteEngine     On
        RewriteRule       ^(.*)$$1  [P]
Just substitute your ServerName with the domain you're hosting and then the RewriteRule http:// point to the IP Address of the other private web server you have running apache.

And you should actually be able to run apache on port 8080 for the second server, you just need to make sure the router forwards the request on port 8080 to the correct server listening on port 8080.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Web server Static Ip From Home a6april Linux - Server 8 10-15-2007 01:14 PM
Web servers keep going down and up. kyleterry Linux - Server 2 06-13-2007 02:05 PM
adding more web servers to make web server farm linuxboy69 Linux - Networking 5 07-09-2004 09:50 AM
Web & Email servers w/ 1 static IP ghight Linux - Networking 2 01-14-2004 01:25 PM
2 web servers hawkes Linux - Networking 3 05-24-2001 10:39 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration