News: This forum is now permanently frozen.
Pages: [1]
Topic: several webservers (DNS forwarder)  (Read 2256 times)
« on: June 20, 2010, 20:25:13 »
richardv *
Posts: 26

I have two webservers on myn LAN:
192.168.1.10 webserver 1 (Windows 2003 with WAMPP)
192.168.1.11 webserver 2 (Windows 2003 with WAMPP)

Example: site www.example1.com is on server 1 and site www.example2.com is on server 2
So I make two rules in DNS forwarder

Domein= example1.com  /  IP=192.168.1.10  /  Description=www.example1.com
Domein= example2.com  /  IP=192.168.1.11  /  Description=www.example2.com

In the httpd.vhost.conf of XAMPP on server1:

<VirtualHost 192.168.1.10:80>
ServerAdmin test@test.nl
DocumentRoot "D:/www/example1"
    ServerName www.example1.com
    ServerAlias www.example1.com
    ErrorLog "logs/example1-error.log"
    CustomLog "logs/example1-access.log" combined
</VirtualHost>

In the httpd.vhost.conf of XAMPP on server1:
<VirtualHost 192.168.1.11:80>
ServerAdmin test@test.nl
DocumentRoot "D:/www/example2"
    ServerName www.example2.com
    ServerAlias www.example2.com
    ErrorLog "logs/example2-error.log"
    CustomLog "logs/example2-access.log" combined
</VirtualHost>

What must I do with port 80?
In NAT port 80 goes to 192.168.1.10 buts thats wrong (server2?)

So all the www traffic goes to server 1 and not to server 2 (in case of www.example2.com)...
« Reply #1 on: June 27, 2010, 22:26:09 »
f41thr *
Posts: 28

Hi Richard,

that is tricky. This mainly depends on your the capability of your domain provider.

You need an url hiding redirekt.
Consult your Domain Hoster if thisis supprted.

redirect example1.com to your external m0no IP port 80
redirect example2.com to your external m0no IP port 81

do the necessary firewall configuration on your m0n0

you need two nat rules
port 80 to  192.168.1.10 port 80
port 81 to  192.168.1.11 port 80

I'm not able to do tests, but should work.

Regards

F41THR

(some corrections)

I have two webservers on myn LAN:
192.168.1.10 webserver 1 (Windows 2003 with WAMPP)
192.168.1.11 webserver 2 (Windows 2003 with WAMPP)

Example: site www.example1.com is on server 1 and site www.example2.com is on server 2
So I make two rules in DNS forwarder

Domein= example1.com  /  IP=192.168.1.10  /  Description=www.example1.com
Domein= example2.com  /  IP=192.168.1.11  /  Description=www.example2.com

In the httpd.vhost.conf of XAMPP on server1:

<VirtualHost 192.168.1.10:80>
ServerAdmin test@test.nl
DocumentRoot "D:/www/example1"
    ServerName www.example1.com
    ServerAlias www.example1.com
    ErrorLog "logs/example1-error.log"
    CustomLog "logs/example1-access.log" combined
</VirtualHost>

In the httpd.vhost.conf of XAMPP on server1:
<VirtualHost 192.168.1.11:80>
ServerAdmin test@test.nl
DocumentRoot "D:/www/example2"
    ServerName www.example2.com
    ServerAlias www.example2.com
    ErrorLog "logs/example2-error.log"
    CustomLog "logs/example2-access.log" combined
</VirtualHost>

What must I do with port 80?
In NAT port 80 goes to 192.168.1.10 buts thats wrong (server2?)

So all the www traffic goes to server 1 and not to server 2 (in case of www.example2.com)...
« Last Edit: June 28, 2010, 23:26:15 by f41thr »
« Reply #2 on: July 09, 2010, 23:47:46 »
brushedmoss ****
Posts: 446

m0n0wall only looks at layer3, i.e. tcp port 80.  it doesn't care that you are doing http on that port, and can only forward traffic to one inside/nat host.

you would need to have your windows server have content for both example.com and example2.com and be configured to serve the right content back based on the http header request. 
 
Pages: [1]
 
 
Powered by SMF 1.1.20 | SMF © 2013, Simple Machines