My apologies if this has been asked before. I haven't found an adequate solution so... yeah.
When a specific domain, "example.com" is accessed, I want it to act normally. In other words, it should go to port 80 as expected and interact with Apache.
When a different sub-domain, "mc.example.com" is accessed, I don't want it to access the Apache web server. I want it to go interact with a different program, listening on, say, port 4096. Thus, going to "mc.example.com" would have the same/similar function as "example.com:4096". If it helps, the service is Minecraft
When a third sub-domain, "vpn.example.com" is accessed, I want it to go interact with a different service, listening on, say, port 687. If it helps, the service is openVPN
Is there a simple way to do this? If so, what is it? Does it involve configuring a VirtualBox in Apache (a method I tried and failed miserably. xD)? Or can it be done using ipTables? If it means anything, I am running 32-bit Centos 5.5(I believe. Its a recent version of Centos)
Thanks for your help.