Results 1 to 6 of 6
-
22-04-2012, 05:17 #1
-= TeamSpeak User =-
- Join Date
- Apr 2012
- Posts
- 11
Teamspeak 3 Server Subdomain Redirect
Hi all!
I have a CentOS 6.2 dedicated server with Plesk 10.4.4 and a domain installed. Let's call that domain example.com and let's say that the server IP is 1.2.3.4.
My DNS setup is as follows:
example.com A 1.2.3.4
www.example.com CNAME example.com
ftp.example.com CNAME example.com
webmail.example.com A 1.2.3.4
When I type in my browser example.com or www.example.com I can see my website.
When I type ftp.example.com I am being prompted for FTP username and password.
When I type webmail.example.com I see the login form for my webmail server.
I also have a TeamSpeak 3 server installed on that server, which is running on default port 9987. So the TS server IP is always the same: 1.2.3.4. If I open my TeamSpeak 3 client and I connect to 1.2.3.4 (without specifying the port number) I log into my TS server,
I created a new DNS CNAME record: ts.example.com like that:
ts.example.com CNAME example.com
If I use my TS client to connect to ts.example.com I log into my TS server... and that's ok. But now I would like to improve those settings. My questions are:
1) How can I prevent clients to connect to my TS server using example.com, www.example.com, ftp.example.com or webmail.example.com?
2) How can I allow clients to connect to my TS server using ONLY ts.example.com?
3) How can I set up my server so that if a user type ts.example.com on its browser, he gets redirected to a teamspeak link like teamspeak://ts.example.com/ instead of viewing my website?
4) I'm using Chrome as browser, and if I type something like teamspeak://example.com:9987/ or teamspeak://1.2.3.4:9987/ I just get redirected to a Google search... and my TS client is not being launched. Why?
Many thanks in advance!
-
22-04-2012, 09:52 #2
-= TeamSpeak Guru =-
- Join Date
- May 2010
- Posts
- 6,372
Hello
For the questions 1) and 2)
You could use the TSDNS server (on the tsdns folder - server folder).
Edit the tsdns_settings.ini.sample file and add this line :
Save and rename the file to tsdns_settings.ini and start the TSDNS.Code:ts.example.com=1.2.3.4
Now when a user try to connect on ts.example.com -> no problem
When he try to connect on example.com or ftp.example.com -> Error message : The TSDNS server 'example.ft' does not know 'ftp.example.com'
For the question 3)
You could create an index.php file with this:
(or with the ts.example.com address)PHP Code:<?php
echo "<meta http-equiv=\"Refresh\" content=\"0; URL=ts3server://1.2.3.4\" />";
?>
For the question 4)
This not the good link. You have to use ts3server://1.2.3.4 link.
(The default port is not required).
To have an idea and all syntax about this command, use the Invite Buddy tool : Tools > Invite Buddy
-
22-04-2012, 14:26 #3
-= TeamSpeak User =-
- Join Date
- Apr 2012
- Posts
- 11
florian_fr40 thank you very much for your precious help!
1) and 2) is now working LIKE A CHARM.
For what concerns questions 3) and 4)... the problem is that ts.example.com is only a CNAME so it doesn't have an httpdocs directory to put php files inside. I'm using Apache and PHP as module... do I have to create a rewrite rule?
Another question... if I insert a link like ts3server://... in my browser, I just get redirected to a google failed search page... they don't seem to work... need to set them up somehow with a plugin?
Thanks again!
-
22-04-2012, 19:22 #4
-= TeamSpeak Fanatic =-
- Join Date
- Jan 2010
- Location
- Germany
- Posts
- 2,038
It doesn't work if you put it in the address bar, but if you have a webpage containing a link like TeamSpeak Link and you click it, your Browser should ask you if you would like to run an external Application to open that link, given of course that you have Teamspeak installed.
You could either go with Apache VirtualHosts or the following Rewrite Rule should work aswell:
Code:RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} =ts3.example.com RewriteCond %{REQUEST_URI} !^/ts3rd/(.*)$ RewriteRule ^(.*)$ ts3rd/ts3.example.com RedirectMatch ^/ts3rd/(.*)$ ts3server://$1
-
23-04-2012, 00:18 #5
-= TeamSpeak User =-
- Join Date
- Apr 2012
- Posts
- 11
Ahem... I need to say I was terribly wrong. Being ts.example.com a CNAME, it's pointing to my server address but when I open it in my browser I don't see my website like if I were in www.example.com... but I see the Plesk default page.
So... how can I set up a specific web page for that CNAME?
Thanks again!
-
23-04-2012, 02:46 #6
-= TeamSpeak Fanatic =-
- Join Date
- Jan 2010
- Location
- Germany
- Posts
- 2,038
You neglected to mention you had Plesk running

iirc Plesk basicly creates VirtualHosts in the Apache Config for each Subdomain / Domain you create in the Panel.
If there is no VirtualHost for the request it gets served by the default Host, which plesk configures to display said page.
Its been some time since I last used plesk so I can't remember where it puts all the stuff (also different depending on OS I think)
In any case I tested the above RewriteRule and found it to be working.
All you should need to do is put the block above in the .htaccess File of the directory that is getting called when you open ts3.example.com
Edit: For Debian / Ubuntu it seems to be /var/www/vhosts/default/htdocs/
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
server redirect
By Sheldon in forum [TeamSpeak 2] General QuestionsReplies: 5Last Post: 10-10-2008, 18:06 -
Bestimmter TS-Server auf Subdomain
By Lord_Luncher in forum [TeamSpeak 2] Server SupportReplies: 5Last Post: 15-06-2007, 23:37 -
Subdomain to Teamspeak server
By lithicus in forum [TeamSpeak 2] Server SupportReplies: 5Last Post: 01-10-2006, 19:49 -
Redirect through subdomain?
By MrWatermonkey in forum [TeamSpeak 2] Server SupportReplies: 5Last Post: 19-06-2003, 05:58


Reply With Quote