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.

How to Make Self-Signed, Shared SSL Work in a Single IP cPanel

Discussion in 'Security' started by xinchen, Aug 14, 2014.

  1. xinchen

    xinchen Registered

    Joined:
    Jul 13, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    I searched cPanel forum and internet, even opened a ticket, but didn't find a definitive solution on that. The solution might be there somewhere but I didn't find it. So I figured out a way to achieve it and like to share it with you, using two fake accounts as an example. You will need to have root access to the server.

    Fake Accounts
    account & domain 1: acctme my.domain.com
    account & domain 2: acctyou your.domain.net

    cPanel Server
    CENTOS 5.10 x86_64 standard – web WHM 11.44.1 (build 11)

    Goal
    Make the following work on a self-signed SSL
    https://my.domain.com
    https://your.domain.net

    Steps
    1. At WHM SSL/TSL section, generate and install a certificate for my.domain.com

    2. Click Manage SSL Hosts and make SSL of my.domain.com shared

    3. ssh to the server and login as root

    4. Open /usr/local/apache/conf/httpd.conf

    5. Locate <VirtualHost xxx.xxx.xxx.xxx:443> that has my.domain.com as server name, where xxx.xxx.xxx.xxx is your cPanel server IP

    6. Copy the whole section of <VirtualHost xxx.xxx.xxx.xxx:443> ... </VirtualHost> to a temporary file and quit httpd.conf

    7. Edit the temorary file and replace the content as follows

    • acctme -> acctyou
      my.domain.com -> your.domain.net
      domain.com -> domain.net

    8. WHM -> Apache Configuration -> Include Editor. Select Post Virtual Host Include and select apache version

    9. Copy the content of the temporary file, paste it into the input area and click Update

    Now you can visit https://my.domain.com and https://your.domain.net, each shows its own home page.

    Hope this can save others' time who are looking for the same solution.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,807
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Note that the better option is to simply install the certificate directly via Web Host Manager. SNI is supported with CentOS/RHEL/CloudLinux versions 6 and higher, so you can install multiple certificates on the same IP address.

    Thank you.
     
Loading...

Share This Page