View previous topic :: View next topic |
Author |
Message |
Taevin n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 09 Feb 2005 Posts: 6
|
Posted: Fri Mar 04, 2005 10:05 pm Post subject: Subdomain Redirection |
|
|
What I would like to be able to do is redirect subdomains to different PCs on my internal network. That is, say I have mydomain.com registered, I would like all traffic on server1.mydomain.com sent to say, 192.168.1.20 and all traffic on server2.mydomain.com sent to say, 192.168.1.30. The tricky part is, of course, that I have only one external IP address. Is there ANY way to do this?
It doesn't matter what I have to use to do this if it is possible and I don't mind doing my own research, I just need to know where to start. From what I can tell, iptables can only route from the external IP address to different internal IP addresses based on ports and Apache virtual hosting only works with HTTP traffic right? Any information would help me a lot, even if it's "you can do it but you'll have to spend thousands of dollars doing it with x, y, and z." |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
steveb Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/1198140199438f3db8ee800.gif)
Joined: 18 Sep 2002 Posts: 4564
|
Posted: Fri Mar 04, 2005 11:19 pm Post subject: |
|
|
This will not work. Some protocols don't even use or send the DNS name when they connect.
For example SMTP:
server 1:
ip: 1.2.3.4
fqdn: server1.mydomain.com
server 2:
ip: 1.2.3.4
fqdn: server2.mydomain.com
Now if a client or a server connect to server2.mydomain.com, then the SMTP server lissening at 1.2.3.4 does not know anything about to what fqdn you connected. Techicaly it could be server1.mydomain.com or server2.mydomain.com.
cheers
SteveB |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
rang3r n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/BaldursGate/baldursgate_kivan.gif)
Joined: 09 Jun 2004 Posts: 25
|
Posted: Wed Apr 13, 2005 4:34 am Post subject: |
|
|
Sorry if this post is too old. I ran across it and thought I would try to help.
Actually if I understand the question right, you could use mod_proxy which is included in apache2 to do this.
Example:
test.domain.com
test2.domain.com
both domains point to the same IP address on DNS
On one of the servers try something like this:
<VirtualHost *.80>
ServerName test.domain.com
DocumentRoot /var/www/localhost/htdocs
</VirtualHost>
<VirtualHost *.80>
ServerName test2.domain.com
ProxyPass / http://server2.local/
ProxyPassReverse / http://server2.local/
</VirtualHost>
This would direct all traffic going to test2.domain.com to a second server internally at http://server2.local.
Hope this helps. _________________ rang3r |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
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
|
|