Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

Setting up multi-site hosting environment

Discussion in 'Bind / DNS / Nameserver Issues' started by mdsupport, May 7, 2017.

  1. mdsupport

    mdsupport Member

    Joined:
    May 7, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Website Owner
    Hello all,

    We are using Amazon AWS as our host, and will be setting up a hosting environment using cPanel.

    One of the features we'd like to have is having a "temporary url" where the client can go and see the finished website.

    One route would be to enable the option in WHM:
    -ourhost.com/~website1/
    -ourhost.com/~website2/, ... etc

    However that's no longer enabled by default and has serious security issues.

    How else would you recommend we set up our environment in such a way as to have a URL that each client can visit their new website at, WHILE their existing website is still sitting on their domain name?

    Any help on this would be incredibly appreciated....
     
  2. Eminds

    Eminds Well-Known Member

    Joined:
    Nov 10, 2016
    Messages:
    211
    Likes Received:
    13
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    If you do not like to enable the temp URL option as you have described in your post , the other way to resolve the domain locally that is hosted on your new environment which can be done by adding server IP and website name in hosts file of the machine from where you are browsing the website.
     
    mdsupport likes this.
  3. mdsupport

    mdsupport Member

    Joined:
    May 7, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Website Owner
    Thank you Eminds. The problem with that is that it requires us going into the clients' physical computer and configuring their hosts file. But they may not even have a *nix machine.

    Surely there must be a way to provide the client with a staging URL link...
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,745
    Likes Received:
    312
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Apache mod_userdir Tweak - Version 64 Documentation - cPanel Documentation

    I'm not aware of any real security issues setting this up.

    You could always use directories instead.
    example.com/user1
    example.com/user1
     
    mdsupport likes this.
  5. mdsupport

    mdsupport Member

    Joined:
    May 7, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Website Owner
    Oh, so the only downside is the bandwidth usage?

    What about the security concern that an attacker could just bruteforce,
    example.com/~aa/
    example.com/~ab/
    example.com/~ba/
    example.com/~bb/
    example.com/~aaa/

    And thus determine all the cPanel accounts in this WHM deployment?


    You can do that? How?
    Thanks!!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, that's also a possibility. You should also review the "Warnings" section of the Apache+mod_userdir+Tweak document to see a list of other potential concerns when enabling this feature.

    As for accessing the websites via directories (e.g. example.com/user1), you'd have to add the domain names under an existing cPanel account with a resolving domain name as Addon Domain names. Editing the hosts file on the local machine is still the best approach in my opinion. We have a guide on how to do this across multiple Operating Systems as:

    [Tutorial] Editing your local hosts file to preview sites

    Thank you.
     
    mdsupport likes this.
  7. mdsupport

    mdsupport Member

    Joined:
    May 7, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Website Owner
    Thank you both so far, this is most helpful!

    Would you mind explaining how to do this in a more detail?

    If we can avoid having a tilde (~) url, then we protect ourselves from bruteforce attacks, which assume that an enabled mod_userdir will have a tilde in the url.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,424
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This is only possible if you create a single cPanel account and add all other domain names under it as Addon Domains:

    Addon Domains - Documentation - cPanel Documentation

    It wouldn't work if you utilize separate cPanel accounts or if the cPanel accounts are operated by different people.

    Thank you.
     
    mdsupport likes this.
  9. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,745
    Likes Received:
    312
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    How long do you think the new site will be available to the new client in the fashion you're looking at doing? I ask as if it's only a temporary thing, assuming it is, why not create the new site in a directory on the ourhost.com website you mentioned in the OP?

    ourhost.com/johnssite/
    ourhost.com/sally/
    ourhost.com/sam/

    Create and display the site, even pass protect it for privacy if you wish. When it's time to move them to their own account, backup the directory and the database and restore on the new account, after it's been created.

    Your footprint is smaller to protect and you'll have access to all sites quick and easy.
     
    mdsupport likes this.
  10. mdsupport

    mdsupport Member

    Joined:
    May 7, 2017
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Website Owner
    Thanks for the thought. The reason this cannot work in our case that these are all Wordpress sites on our end. So if I install the "sally" site in ourhost.com's website and database, there's no turnkey migration of the kind you describe. Plus, the parent database has this residue left in it, unless cleaned up; and if you multiply that by 10-20-30 sites (if we plan to host more of our clients), that quickly makes the parent databse polluted.

    I'm beginning to wonder how professional hosting companies do this!
     
  11. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,745
    Likes Received:
    312
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    My apologies, I assumed you were doing website design work, and would be displaying the style or something for a limited amount of time. Creating addon domains might work assuming you've got those 30 domains' DNS already pointed at your server. Once the site is ready you could convert the addon into its own cPanel account:
    Convert Addon Domain to Account - Documentation - cPanel Documentation
     
Loading...

Share This Page