Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 6 of 6

This is a discussion on Wildcard subdomains, the easy way :) in the VPS & Dedicated forum
Hi all, This is a small tutorial about doing it Add the following in DNS (or add it in the default template, as you wish): ...

  1. #1
    XoK
    XoK is offline
    Giv me the number for 911 XoK's Avatar
    Join Date
    Feb 2007
    Posts
    121

    Wildcard subdomains, the easy way :)

    Hi all,

    This is a small tutorial about doing it

    Add the following in DNS (or add it in the default template, as you wish):

    *.domain.tld. A vps_id_address



    And the best part is the following!

    Access by SSH and type the comand (1 line only),
    it replaces "ServerAlias www." with "ServerAlias *." on every website config file of .com's, in the VPS!

    Code:
    find /var/www/vhosts/*.com -iname httpd.include -type f -exec sed -i 's/ServerAlias  www./ServerAlias  *./' {} \;

    I love being lazy

  2. #2
    JPC Support Smithjp's Avatar
    Join Date
    Jun 2006
    Location
    Planet Earth
    Posts
    166
    It will work for Plesk VPS only. For other control panels, the path needs to be modified.

  3. #3
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Hrm... Extrapolating...

    Are you hinting that wildcard subdomains work with Plesk, Mr. Smith, without modification?
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  4. #4
    JPC Guru
    Join Date
    Apr 2006
    Location
    Sweden
    Posts
    263
    It works with the modification of the first post, that's what Smith is refering to I think.

    "/var/www/vhosts/" is the address for Plesk virtual host files.
    My VPS server:
    www.myfedoraserver.com


  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I see...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  6. #6
    XoK
    XoK is offline
    Giv me the number for 911 XoK's Avatar
    Join Date
    Feb 2007
    Posts
    121
    Hello,

    Thanks for pointing that!

    I am moving sites to a VPS, and that instruction is giving me less work
    I had to edit many files to do that...

    I searched a lot to learn how to to do that in a single command!

    I am a complete "noob" in Linux and SSH


    Quote Originally Posted by JPC-Smith View Post
    It will work for Plesk VPS only. For other control panels, the path needs to be modified.

Bookmarks

Posting Permissions

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