Forum

Results 1 to 6 of 6
  1. #1
    Join Date
    April 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!

  2. #2
    Join Date
    May 2010
    Posts
    6,310
    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 :
    Code:
    ts.example.com=1.2.3.4
    Save and rename the file to tsdns_settings.ini and start the TSDNS.

    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:
    PHP Code:
    <?php   
    echo "<meta http-equiv=\"Refresh\" content=\"0; URL=ts3server://1.2.3.4\" />";   
    ?>
    (or with the ts.example.com address)

    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

  3. #3
    Join Date
    April 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!

  4. #4
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029
    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

  5. #5
    Join Date
    April 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!

  6. #6
    Join Date
    January 2010
    Location
    Germany
    Posts
    2,029
    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

  1. How I can install teamspeak in subdomain
    By Games-K in forum Linux / FreeBSD
    Replies: 11
    Last Post: October 17th, 2014, 07:17 PM
  2. Redirect from own URL to IP to Teamspeak
    By wanroto in forum Linux / FreeBSD
    Replies: 2
    Last Post: December 18th, 2013, 07:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •