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.

Second https port for Apache

Discussion in 'Security' started by JanKrohn, Oct 9, 2015.

  1. JanKrohn

    JanKrohn Active Member

    Joined:
    May 6, 2013
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Phnom Penh
    cPanel Access Level:
    Root Administrator
    Hi,

    My current setup is as follows. I have two folders, one for my main site example.com and one for the test at play site beta.example.com

    Obvious problem here: I can't test SSL on the subdomain because I own no certificate for that.

    So I'm looking for a way to set up the beta site on example.com:3000 (or another suitable port).

    any ideas how to accomplish that.....?

    Thanks!
    Jan
     
    #1 JanKrohn, Oct 9, 2015
    Last edited by a moderator: Oct 9, 2015
  2. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    942
    Likes Received:
    57
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Personally I would just create a self-signed certificate for the sub domain in WHM and install it for testing purposes.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    You could install a separate self-signed SSL certificate for the subdomain, as mentioned in the previous post, as long as you are using an OS that supports SNI (e.g. CentOS/RHEL/CloudLinux 6 or higher).

    Thank you.
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Add a Listen command to one of the Apache include files, i.e /usr/local/apache/conf/includes/pre_main_2.conf

    Code:
    Listen 0.0.0.0:3000
    Then add a VirtualHost entry for the subdomain in another include file, i.e. /usr/local/apache/conf/includes/pre_virtualhost_2.conf

    Code:
    <VirtualHost %ip%:3000>
    .
    .
    .
    SSLEngine on
    SSLCertificateFile ...
    SSLCertificateKeyFile ...
    SSLCACertificateFile ...
    .
    .
    .
    </VirtualHost>
    Restart Apache

    Make sure port 3000 is open in your firewall.
     
Loading...

Share This Page