Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto: Apache subdomain forwarding to local machines
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Ausdonky
n00b
n00b


Joined: 12 May 2004
Posts: 15
Location: Brisbane, Oztralia :)

PostPosted: Wed Feb 02, 2005 6:21 am    Post subject: Howto: Apache subdomain forwarding to local machines Reply with quote

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
View user's profile Send private message
tuxamd
Apprentice
Apprentice


Joined: 28 Jan 2005
Posts: 281

PostPosted: Fri Feb 04, 2005 6:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Ausdonky
n00b
n00b


Joined: 12 May 2004
Posts: 15
Location: Brisbane, Oztralia :)

PostPosted: Mon Feb 07, 2005 11:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum