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.

Apache config for sharing domain document root

Discussion in 'Workarounds and Optimization' started by Jarod Thornton, Jun 15, 2017.

  1. Jarod Thornton

    Jarod Thornton Registered

    Joined:
    Jun 15, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Lexington Ky
    cPanel Access Level:
    Root Administrator
    I have searched and searched without finding any solid resource for allowing the following scenario. Any insight and feedback is appreciated.

    Server

    • Apache/2.4.25
    • CENTOS 7.3 x86_64 kvm – host
    • cPanel & WHM 64.0 (build 24)
    • php 5.6
    Global Configuration

    • ExecCGI *enabled
    • FollowSymLinks *enabled
    • Includes *enabled
    • IncludesNOEXEC *enabled
    • Indexes *enabled
    • MultiViews *enabled
    • SymLinksIfOwnerMatch *disabled
    example.com is on ~one, but it's documentroot needs to point to ~two

    This is the vhost file of one.com attempting to reference the root of ~two:
    Code:
    documentroot: /home/two/public_html
    group: one
    hascgi: 1
    homedir: /home/one
    ip: ##########
    ipv6: ~
    no_cache_update: 1
    owner: owner
    phpopenbasedirprotect: 1
    serveralias: exmple.com mail.example.com www.example.com
    servername: example.com
    usecanonicalname: 'On'
    user: one
    userdirprotect: one
    
    The error I get is that /home/two/public_html is not owned by ~one. Of course it's not.

    How can I setup this domain to point to a different document root?
     
    #1 Jarod Thornton, Jun 15, 2017
    Last edited by a moderator: Jun 15, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. Jarod Thornton

    Jarod Thornton Registered

    Joined:
    Jun 15, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Lexington Ky
    cPanel Access Level:
    Root Administrator
    So we ditched the first attempt to override vhost and decided to setup the following:

    • domain1 has dedicated IP
    • domains use shared IP
    • domain2 is on it's own cpanel so client can use email etc
    • domain2 has an A record pointing to domain1 dedicated IP
    This works, however I am now unable to get autossl to work with this setup. None of the common names in the certificate match the name that was entered.

    How can I overcome this?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The issue is that it's going to load the certificate associated with the domain name on the other cPanel account, and thus not match the domain name entered in the browser. The only true way to support sharing a document root would be to have the domain names be part of the same cPanel account through the use of addon domain names.

    Thank you.
     
  5. Jarod Thornton

    Jarod Thornton Registered

    Joined:
    Jun 15, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Lexington Ky
    cPanel Access Level:
    Root Administrator
    I understand.

    So our goal is to provide our clients (if they wish) a dedicated cPanel environment for their hosting. We also offer a managed WordPress service which is on it's own dedicated cPanel account. Some clients may have multiple domains on their cPanel and want to use the managed WordPress service for one. That is what we are trying to setup. If they were on a separate host we could just create the A record to the IP for the managed WP service.

    Do you have a suggestion for a solid workaround to this so we can provide this kind of split service?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page