OpenVZ Forum


Home » General » Support » name based hosting
Re: name based hosting [message #25062 is a reply to message #25019] Thu, 13 December 2007 19:37 Go to previous message
Thomasd is currently offline  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 Smile

[Updated on: Thu, 13 December 2007 19:37]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SSH to VE is very slow
Next Topic: ssh VPS doesn't work outsite Node server
Goto Forum:
  


Current Time: Sun Oct 20 18:11:11 GMT 2024

Total time taken to generate the page: 0.05251 seconds