View previous topic :: View next topic |
Author |
Message |
Ausdonky n00b

Joined: 12 May 2004 Posts: 15 Location: Brisbane, Oztralia :)
|
Posted: Wed Feb 02, 2005 6:21 am Post subject: Howto: Apache subdomain forwarding to local machines |
|
|
Hi Guys,
I dont know if this will be of any use to anyone but i found almost no help on this topic on the web. I have apache serving multiple subdomains but needed to have another machine (windows server) serve a webpage but totally transparent to the outside world. I tried things like using rewrite etc but this didnt seem to want to work. Anyway the following works really well and handles the whole lot transparently.
exert from /etc/apache2/conf/vhosts.conf
Code: |
<VirtualHost *:80>
ProxyPass / http://<my internal ip>/
ProxyPassReverse / http://<my internal ip>/
ServerName subdomain.main-dn.com
</VirtualHost>
|
I know this is super simple but i could not find anything else that did this so i hope this can help someone else
Andrew |
|
Back to top |
|
 |
tuxamd Apprentice


Joined: 28 Jan 2005 Posts: 281
|
Posted: Fri Feb 04, 2005 6:37 am Post subject: |
|
|
Can that also forward to another port? Lets say I made a ventrilo.domain.com and had it forward to another computer with ventrilo on it? I'll have to try that out thanks for sharing it  |
|
Back to top |
|
 |
Ausdonky n00b

Joined: 12 May 2004 Posts: 15 Location: Brisbane, Oztralia :)
|
Posted: Mon Feb 07, 2005 11:38 am Post subject: |
|
|
hmmm.. i dont know how well that would work because ventrilo would have a lot of traffic and could cause lag through apache.. Im thinking itd be a whole lot easier to port forward the normal ventrilo port through to this other server and then set up a subdomain with your dns provider as ventrilo.domain.com to point to your external interface. this of course would forward anything coming in to your server on that port wether they use ventrilo or not.. but hmm you could probably add in a thing to only forward if the requested dns name is ventrilo.*
maybe:
iptables -t nat -A PREROUTING -i <incoming interface> --dport <ventrilo port> -j DNAT -d ventrilo.domain.com --to <internal IP>:<ventrilo port>
not too sure if you would also want to specify the transport protocol (ie tcp or udp but im thinking it would prolly just use udp so you would just add -p udp also..)
Also youd need to setup ventrilo.domain.com to point to your server for this to work.. ie they both resolve to the same ip
I guess this would also work for what i am doing now that i think about it.. ill have to give it a go some time
Andrew |
|
Back to top |
|
 |
|