Re: name based hosting [message #25062 is a reply to message #25019] |
Thu, 13 December 2007 19:37 |
Thomasd
Messages: 39 Registered: December 2007
|
Member |
|
|
so, if I take this example:
Apache VPS at 10.0.0.1 (a.com) and 10.0.0.2 (b.com)
should I create a proxy VPS, let's say at 10.0.0.3,
then forward port 80's traffic to it with:
ptables -t nat -A PREROUTING -p TCP -d m.y.i.p --dport 80 -j DNAT --to-destination 10.0.0.3
then, set apache (on 10.0.0.3) with:
VirtualHost m.y.i.p:80>
ServerName a.com
RewriteEngine On
RewriteRule ^(.*)$ http://10.0.0.1$1 [P]
RewriteRule ^(.*)$ http://www.a.com$1 [P]
</VirtualHost>
<VirtualHost m.y.i.p:80>
ServerName b.com
RewriteEngine On
RewriteRule ^(.*)$ http://10.0.0.2$1 [P]
RewriteRule ^(.*)$ http://www.b.com$1 [P]
</VirtualHost>
Is that correct?
Once I get it right, I think I'll write a wiki page about it
[Updated on: Thu, 13 December 2007 19:37] Report message to a moderator
|
|
|