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.

SOLVED Configure cPanel for non webhosting company

Discussion in 'General Discussion' started by jeff brown, May 2, 2017.

  1. jeff brown

    jeff brown Member

    Joined:
    May 2, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Costa Rica
    cPanel Access Level:
    Root Administrator
    Hi cPanel Forums,

    My company currently internally hosts 60+ PHP internally facing websites in 4 different environments. All of these are subdomains as in foo.internal-company-hosting.net, bar.internal-company-hosting.net, baz.internal-company-hosting.net.

    And as we are in the process of re-architecting our systems, the company's IT has recently chosen cPanel as an engine/system for several reasons.

    However, this leaves me with the job of transitioning from an old standard-ish LAMP stack setup without cPanel to a version using cPanel.

    I had some time to play around and found it pretty easy just making a new user for each of these sites, as if we were selling an web-hosting account. It worked pretty seamlessly, but then that would create 60+ new users, meaning developers would need to either maintain another long set of passwords, or have some su/sudo powers just to get around into the sites. Not to mention our previous disk space hosting doesn't easily fit with the default website construction in user subdirectories.

    I then tried to find a way to spin off parallel sites under one user, and ran into several smaller hiccups. Which left me with a bit of a sour taste in my mouth.

    So, I really have 2 main questions here:

    1] is there a way to 'by configuration' or 'by hand' ensure that websites are created under a known mount point /foobar rather than as subdirs under a user.

    2] is there an easy way to add/spin off multiple subdomain sites under a single user.

    I do have a few more automation style questions, but these are the two big ones.

    Thanks,
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Setting up a single cPanel account, and then adding each separate website as an Addon Domain name to that account, is the best approach if you want to provide a developer with access to all of the websites without requiring the developer to login as a different username for each new FTP or SSH session. The Addon Domains feature is documented at:

    Addon Domains - Documentation - cPanel Documentation

    Could you let us know of the issues you faced when initially attempting this type of setup?

    This isn't supported due to the potential security risks and due to how Apache/PHP interact with directories not owned by the account username.

    Thank you.
     
    jeff brown likes this.
  3. jeff brown

    jeff brown Member

    Joined:
    May 2, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Costa Rica
    cPanel Access Level:
    Root Administrator
    Thanks for the direct link! I'll try this presently. Regarding the issues I had earlier, I'll chalk it up to me bumbling around if things go smoothly with this new info.


    Ok, and I totally understand why a real hosting company and/or hosting re-seller would need to be careful with this. However, as I mentioned initially, we're not hosting per/se, and it's an internal server where only developers have access, so there really should be no security risk, and we can ensure that '/foobar' is owned by the appropriate user. Is there a non supported way we can tweak this? or are we going to have to build symbolic links all over the place?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,419
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Here's a thread where a user configured something like this:

    Share Directory Across Multiple Accounts

    However, my advice would be to go with the Addon Domain option because using an unsupported method of setting up the accounts could result in other features not working as expected (e.g. Mod Security, PHP-FPM).

    Thank you.
     
    jeff brown likes this.
  5. jeff brown

    jeff brown Member

    Joined:
    May 2, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Costa Rica
    cPanel Access Level:
    Root Administrator
    I'll take a look, but I noticed (on a re-read):

    Sorry what we need are sub-domains not domains, they're all on the same domain. Does that change any of your earlier answers?

    I found a subdomain link from your first one and that seems to be going smoothly.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Using either subdomains or addon domain names would achieve the functionality you are seeking.

    Thank you.
     
    jeff brown likes this.
  7. jeff brown

    jeff brown Member

    Joined:
    May 2, 2017
    Messages:
    7
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Costa Rica
    cPanel Access Level:
    Root Administrator
    Excellent, Thanks to you cPanelMichael for your links and advise. I would mark this as resolved but I can't find a control for it.

    To be clear for any future forum browsing:

    To resolve #1: We chose to use a symbolic link from our mount point to replace the ~/<single-user>/public_html, then applying a chown to ensure user/group ownership was correct. Note that as Michael mentioned, while this works for us in our use case, it probably isn't a correct solution for many situations.

    To resolve #2: For the process of making a new subdomain site, we used the Subdomain link, and the entire process including manually uploading and unzipping files, creating a db/db-user and restoring the db clocks in around 30 minutes. Which is fine for our needs.
     
    cPanelMichael likes this.
Loading...

Share This Page