The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

clientsite.ourhost.com instead of ourhost.com/~clientsite?

Discussion in 'General Discussion' started by navertise, Sep 18, 2004.

  1. navertise

    navertise Member

    Joined:
    Sep 18, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Our company has just set up a VPS, which is our first foray into a non shared hosting world. By default, any sites we create in cpanel would generically show up as vps.ourhost.com/~clientsite. We would like to use a setup where development sites (before liking them to a domain) would show up as clientsite.ourhost.com and once a domain is attached, it would actually work either way.

    I know other web developers have a setup like this, and one of our co-workers worked at a company with such a setup, which allows root-relative links to function (ourhost.com/~clientsite does not).

    I don't know where to begin with this and whether it is a function of cpanel/WHM or something else. Any help would be appreciated.
     
  2. drmike

    drmike Active Member

    Joined:
    Jul 8, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Charlotte, NC
    Create an account using clientsite.ourhost.com as the account name and change it when its ready.

    I would think....

    -drmike
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    This is actually quite simple to do:

    1. Create the client account in cPanel as normal with their intended domain (clientdomain.com)

    2. Add an A record in ourhost.com's DNS zone file for clientsite.ourhost.com

    3. Edit your /etc/httpd/conf/httpd.conf

    Search for the VirtualHost container for clientdomain.com and within the VirtualHost directive add the line:

    ServerAlias clientsite.ourhost.com

    4. Reload Apache:

    httpd graceful

    That should be it, though their is one caveat:

    If you intend to send email to clientdomain.com from the same server, but clientdomain.com does not yet point to your server (i.e. their MX DNS record points elsewhere) then you must do the following:

    Remove clientdomain.com from /etc/localdomains and add it to /etc/remotedomains.

    Reverse the above when they move to your server.
     
  4. navertise

    navertise Member

    Joined:
    Sep 18, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    If I only wanted to have the secondary URL (clientname.ourhost.com) BEFORE attaching it to a domain (clientname.com), could I just change the URL field under "modify account" when I'm ready, as drmike suggests?

    Actually I tried this, and it didn't work quite like I thought. I had previously set up an account with the URL clientname.com. I attempted to change the URL field under "modify an account" to clientname.ourhost.com, and it worked. However, I tried to change it back to clientname.com (to simulate the project being done), and it says there is already an account with this name, and keeps the clientname.ourhost.com URL.

    Any ideas?
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That's the danger of not using the method that I gave you. Changing the account domain is fraught with danger and I would never recommend it.

    To fix, you probably need to go and edit your /etc/httpd/conf/httpd.conf file and search for instances of clientname.ourhost.com and remove them carefully (if it has its own VirtualHost container remove it). Then restart httpd.

    then I'd recommend using my approach ;)
     
  6. bmuthig

    bmuthig Member
    PartnerNOC

    Joined:
    Feb 15, 2004
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ann Arbor, MI
    cPanel Access Level:
    DataCenter Provider
    Anybody have this automated?

    Does anybody have this automated? I'd also like to do this but obviously not by hand. Suggestions?
     
  7. navertise

    navertise Member

    Joined:
    Sep 18, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1

    OK, I'm finally listening to reason and trying this method. However, I'm stuck at #2 (but I think I'll be fine with the rest once I get past that. I'm not sure where in cpanel to go to "Add an A record in ourhost.com's DNS zone file for clientsite.ourhost.com". Which link should I go from in cpanel, and what should I enter? I looked at the choices in cpanel, and they confused me somewhat.
     
  8. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    You need to do this in WHM or via shell access.
     
  9. navertise

    navertise Member

    Joined:
    Sep 18, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Sorry, I meant WHM. Which option do I choose to set this up?
     
  10. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    In WHM > DNS Functions > Edit a DNS Zone.
     
  11. navertise

    navertise Member

    Joined:
    Sep 18, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    OK, I finally figured it out.

    Is there anything different that has to be done is the site is on a different IP address? All of the ones I tried that share an IP address with the server's main domain work fine, but one that is on the same server, but has a different IP address won't resolve.

    Should this same method work the same accross IP addresses?
     

Share This Page