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.

Wildcard SSL - Or - Appending to a file

Discussion in 'cPanel Developers' started by TimPhin, Apr 24, 2015.

  1. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
    Using WHM API / cPanel API 2 I was able to successfully allow users to create accounts on my server which automatically created them cPanel accounts with a sub domain on the main server domain.

    Installed a wildcard SSL only to find out it won't cover these sub domains because they are not in the root domain folder.

    So now I have written so it just creates a sub domain on the main domain cPanel account so it is in that public folder (public_html/subdomain) instead of it's own cPanel account.

    BUTit looks like I will have to modify the .htaccess file just to get the sub domains covered with the SSL. Otherwise when going to httpS it shows the content of the main domain.

    So 2 questions.
    1) Is there is a way to have the SSL cover the sub domain cPanel accounts automatically?

    2) With this solution here, adding entries into the .htaccess file of the main domain for the sub domains, is there a way using Fileman fuctions to append to the .htaccess file information of the new sub domain created?

    Thanks1
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you elaborate on this statement? Does the SSL certificate fail to load, or produce a specific error message?

    Thank you.
     
  3. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
    Hello,

    The wildcard certificate was installed itself.

    Thank you
     
  6. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
    To follow up, the wildcard certificate was installed on the server for the main domain on the server (which also has a cPanel account).

    Since it is a wildcard SSL, is it possible to install it for each sub domain to this domain which are on their own cPanel accounts?
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  8. TimPhin

    TimPhin Member

    Joined:
    Mar 18, 2015
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    AL
    cPanel Access Level:
    Root Administrator
    Thanks for the help. I am able to Browse Certificates -> Select Certificate -> Select the account for the main domain. Then enter in the sub domain for the domain (sub.thisdomain.com). It works (putting it up here in case it helps someone else).

    Now just to see if I can write something with the WHM API to automate it for me.

    Thanks again Michael
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page