I'm working on making my two Minecraft servers easier to access. I've attempted a few solutions, but so far, none have worked effectively.
I have a normal vanilla Minecraft server listening on mysite.com:25560, and a Tekkit Minecraft server listening on mysite.com:25570. That is, both Minecraft servers are running on the same machine. They work properly when users directly connect to the server with the port specified.
The vanilla server was initially listening on mysite.com:25565, the standard Minecraft port. I have changed it so I can allow Apache to listen at mysite.com:25565 and redirect traffic appropriately, but that's not working so far.
What I'd like to be able to do is have all requests sent to mine.mysite.com be redirected to mysite.com:25560, and have all requests sent to tekkit.mysite.com be redirected to mysite.com:25570. I understand that the DNS itself is not capable of managing this reroute, since DNS only handles domain names and IP addresses.
After a suggestion of a friend, my latest attempt has been reconfiguring Apache, as I earlier stated, to listen on port 25565 and proxy the traffic to the correct port. This is a section of my apache2.conf:
Listen 25565
NameVirtualHost *:25565
<VirtualHost *:25565>
ServerName tekkit.mysite.com
ServerAlias www.mysite.com
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPreservehost On
# ProxyPass / www.mysite.com:25570/
ProxyPassReverse / mysite.com:25570/
</VirtualHost>
<VirtualHost *:25565>
ServerName mine.mysite.com
ServerAlias www.mysite.com
ProxyPreserveHost On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
# ProxyPass / mysite.com:25560/
ProxyPassReverse / mysite.com:25560/
</VirtualHost>
The commented-out lines with ProxyPass cause Apache to start with an error ProxyPass URL must be absolute!
To see if I could make it work properly, I then tried substituting http://www.mysite.com:25560/60 in the respective places, and while Apache does start without any errors, users are not able to connect to the server. I believe this is because the Minecraft server does not redirect a HTTP request to a server connection, whichever protocol that may be.
This has led me to believe that Apache won't be helpful in handling non-HTTP requests. If I am mistaken, how might I make Apache correctly redirect subdomain traffic to a port? Otherwise, can anyone suggest a way to do this without Apache? I have access to all standard Linux / Ubuntu utilities. I've been searching for quite some time without progress.
Thanks!