-2

My configuration [ OpenWRT on my Router ] [ Centos 6.4 , Apache 2.4.6 - Machine A ] [ Centos 7, Apache 2.4.6 - Machine B ]

I've 1 IP address pointing to my OpenWRT Router. I had 1 WebServer running websites. and I added a second physical machine to host websites.

Website=WS

External IP --> 10.1.1.1 - OpenWRT Router

10.1.1.121 - WebServer A | WS.1, WS.2, WS.3

10.1.1.131 - WebServer B | WS.6, WS.7

I set up Port forward on the router. The rule on top takes over the other one. let say if the rule forwarding to 10.1.1.121 is first that will take over the other and I'll see WebSites from Webserver A and not websites hosted on WebServer B and vice-verse.

Any idea how can I see Websites from both Machines? I dont mind if I need to setup a proxy, or DNS server or any other software but I couldn't figure what is the best solution for this scenario.

I don't want to ask/get for another IP address neither pointing to my router.

BTW: The Setting with only one Machine either WebServer A or B ( just one machine with Apache) runs well.

Thanks in Advance.

1
  • I don't believe this question belongs elsewhere and its disappointing to see so many down votes without any comments
    – symcbean
    Mar 19, 2015 at 23:29

2 Answers 2

0

You don't need a DNS server, but the fact that you mention this does bring your skills into question.

The simplest solution here is to bump the existing webserver on host A to a different port then run a reverse proxy on http://hosts:80 personally I'd go for pound or haproxy in this context but if it were a more sophisticated setup then Apache Traffic Server.

But the right solution is probably to migrate site B onto host A.

2
  • Thanks symcbean, for all your suggestions. I tested reverse proxy, but I didn't like it that much. I could and I've enough space to migrate Site B onto host A. But I wanted to be prepare for something bigger. I'll give a try to haproxy, I've read that its a good and very stable solution. I'll post my result. Best,
    – Correo
    Mar 20, 2015 at 12:48
  • Thank you for the information. I moved sites B onto hoas A.
    – Correo
    Jan 1, 2016 at 21:20
0

Finally I make it to work, sharing my experience

(10.1.1.121) Landing server configuration Normal Configuration plus

< VirtualHost > and < / VirtualHost > you need to add the open and closing bracket. I couldn't add them on code due limitation of the coding area

VirtualHost *:80
ServerName www.website_04.net
ServerAlias website_04.net
  ProxyPreserveHost on
  ProxyPass / http://10.1.1.131/
  ProxyPassReverse / http://10.1.1.131/
/VirtualHost

VirtualHost *:80 
  ServerName www.website_05.net
  ServerAlias website_05.net

  ProxyPreserveHost on
  ProxyPass / http://10.1.1.131/
  ProxyPassReverse / http://10.1.1.131/
/VirtualHost 

The other web servers (10.1.1.131) would have normal configuration.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .