HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   Forward subdomain to a specific port (UDP & TCP) (http://www.howtoforge.com/forums/showthread.php?t=30775)

dragon` 30th January 2009 16:56

Forward subdomain to a specific port (UDP & TCP)
 
Hi!

I have Ubuntu 8.04 + ISPConfig installed.

I'm trying to forward a subdomain.mydomain.com to the 27010 port of my server.
We will have more game server instances(Counter-Strike) from one game, and because of this we have to use multiple ports.

What i want to work up, is that my players don't need to specify a port when they connects to our servers, example:
-server1.mydomain.com will redirect him to myipaddress:27010
-server2.mydomain.com => myipaddress:27011

The game's default port is 27015. There could be two solutions:
1. all the traffic from server1.mydomain.com will be redirected to myipaddress: port
2. the traffic from the udp://server1.mydomain.com:27015 will be redirected to myipaddress: port

I've tried:
-redirecting with php to udp://ip: port(bad idea :D )
-dns service records
-searching google for a week

The closest solution:
I created an A record for all of my instance names (example: server1.mydomain.com, server2.mydomain.com)
The players now can connect through the subdomains, but they need to specify the port of the servers (server2.mydomain.com:27010)
The disadvantage of this solution is that if the user misses the port, he misses the server too.

The best solution:
-buy more ip addresses(over 15-20 servers is pretty expensive)

Some ideas:
I have to create "virtual ip addresses"
-or local loopbacks ( 127.0.0.2,127.0.0.3) somehow, but maybe it is not possible
-or there will be an openVPN server on this server, and i will allocate more IP-s for my server.
After that i have to point the subdomains somehow to these ip addresses
-/etc/hosts ?? ( point a server1.mydomain.com to 127.0.0.1, and server2.mydomain.com to 127.0.0.2 )
-or with virtual hosting ( but i could not use it with UDP or TCP)

I'm at loss of this now.

Thx,
dragon`

falko 31st January 2009 13:40

You could try APache rewrite rules:
http://httpd.apache.org/docs/2.2/rew...ite_guide.html

dragon` 1st February 2009 11:59

Thx for your reply.

Apache is a HTTP server. It isn't possible to handle UDP requests with a HTTP server. :(

bmwillrath 28th February 2011 15:21

Yess!!!
 
this is exactly i want to do, did you come up with a soloution?
thanks.

dragon` 28th February 2011 15:36

impossible
 
I have asked some experts in the area, but everybody sais it's impossible. Unless you have enaugh number of public IP addresses. You can do it with simple firewall rules, but you need an IP address for each server.

Brahmin 13th June 2013 02:32

I found this solution over here which seems pretty positive.
http://serverfault.com/questions/195...he-same-server

I haven't had a chance to check it out yet but will do so when I get home.

pititis 14th June 2013 01:43

You can use a proxy like proxymini

http://aluigi.altervista.org/mytoolz/proxymini.zip

Supports HTTP, HTTP CONNECT (for HTTPS and so on), SOCKS4 (TCP and TCP bind) and SOCKS5 (TCP, TCP bind and UDP)

Just configure it for listening in the port you want and redirect the traffic to the desiderated IP and port

I used it before for game servers.

Cheers


All times are GMT +2. The time now is 02:42.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.