PDA

View Full Version : Yet another multiple webserver related question...


Rashef
26th May 2009, 18:55
Hi,
I found out some thread with similar questions, but no one of them followed up...

This is my config:

ROUTER

pfSense NAT/FW → LAN

DMZ

There are several servers into the DMZ, providing different services... until now!
Since I have NOW two webserver I need to correctly redirect external requests, but I cannot understand how to do this because I need a strange config.

NODE1 (192.168.50.2) is a CentOS 5.3 mailserver, with RoundCube as webmail.
NODE2 (192.168.50.7) is a Mac OS X running Apache, PHP and MySQL, with lots of websites.

This is what I need

NODE1
http://webmail.myfirstdomain.com ➤ http://192.168.50.2/mail

NODE2
http://www.firsthost.com ➤ http://192.168.50.7/~firsthost_com
http://www.secondhost.com ➤ http://192.168.50.7/~secondhost_com
and so on...

I focused on a combine of mod_proxy a VirtualHosts on Node1 but I cannot understand how to do that...

billcouper81
25th March 2010, 09:28
I don't know how to configure so it will work like that, but I have suggestion

Get two static IP and assign one to each server

You can even do if only one NIC in the machine with virtual NIC assignments:

NODE1 interfaces

auto eth0
iface eth0 inet static
address 192.168.50.2
gateway 192.168.50.1
netmask 255.255.255.0
network 192.168.50.0
broadcast 192.168.50.255

auto eth0:0
iface eth0:0 inet static
address x.x.x.x
netmask z.z.z.z


NODE2 interfaces

auto eth0
iface eth0 inet static
address 192.168.50.7
gateway 192.168.50.1
netmask 255.255.255.0
network 192.168.50.0
broadcast 192.168.50.255

auto eth0:0
iface eth0:0 inet static
address y.y.y.y
netmask z.z.z.z


where
x.x.x.x is real-world IP #1
y.y.y.y is real-world IP #2
z.z.z.z is subnet-mask for these ip range


Then you adjust the nameserver records to point to the particular real-world IP of which server is hosting that particular website

eg:
myfirstdomain.com. A = x.x.x.x
www A = x.x.x.x
webmail A = x.x.x.x

firsthost.com. A = y.y.y.y
www A = y.y.y.y

secondhost.com. A = y.y.y.y
www A = y.y.y.y



That is how I have my servers setup currently (except they have quad physical NIC, so no virtual interfaces)