Skip to main content

Setting up multi-site hosting environment

Comments

10 comments

  • Eminds
    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.
    0
  • mdsupport
    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...
    0
  • Infopro
    However that's no longer enabled by default and has serious security issues.

    Apache"s mod_userdir allows users to view their sites by entering a tilde (~) and their username as the URI on a specific host. For example The disadvantage of this feature is that any bandwidth usage used by this site will be put on the domain it is accessed under (in this case test.cpanel.net). mod_userdir protection prevents this from happening. You may however want to disable it on specific virtual hosts (generally shared ssl hosts).
    0
  • mdsupport
    0
  • cPanelMichael
    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?

    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.
    0
  • mdsupport
    Thank you both so far, this is most helpful!
    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

    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.
    0
  • cPanelMichael
    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.

    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.
    0
  • Infopro
    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.
    0
  • mdsupport
    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.

    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!
    0
  • Infopro
    My apologies, I assumed you were doing website design work, and would be ing 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
    0

Please sign in to leave a comment.