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.

SSL On Server hostname

Discussion in 'General Discussion' started by asent, Feb 6, 2010.

  1. asent

    asent Active Member

    Joined:
    Apr 5, 2005
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Hey everyone,

    How would I go about setting up an SSL on the apache master hostname (eg. host02.myhostingcompany.com) which points to /usr/local/apache/htdocs. The hostname uses the server's main (shared) ip address. I want to set this up here so my hosted accounts who do not have a dedicated ip site could (if they want) go to secure by going to https://host02.myhostingcompany.com/~theirusername/


    I configured the SSL for my hostname for imap/smtp/pop/ftp/whm & cpanel services but also want it setup for the master apache domain.

    The server host name does not appear in ssl hosts, only the dedicated ip sites appear there. I tried to install for the server hostname but did not work and no username (as there is no cpanel account for the master host and the files being owned by root).

    Any suggestions for doing this in WHM or should I do it old school on the cmd with apache. I just don't want cpanel updates to break it.

    Thanks in advance.

    EDIT:

    Tried with user nobody but got some weird syntax errors. I just created the vhost for the shared ip and server hostname on port 443 in /usr/local/apache/conf/includes/post_virtualhost_global.conf and pointed to my crt, key, and ca files and it worked after apache restart. May be useful for others who run into these problems.
     
    #1 asent, Feb 6, 2010
    Last edited: Feb 6, 2010
  2. mattcampbell

    mattcampbell Member

    Joined:
    Sep 7, 2006
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Are you able to post what you added?

    Also did you point to the certificate that was installed through the Manage Service SSL Certificates?
     
  3. asent

    asent Active Member

    Joined:
    Apr 5, 2005
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Yes, I used the same cert and key files generated when I setup SSL on my services in whm.

    Here is the vhost I used:

    Code:
    <IfDefine SSL>
     
    <VirtualHost 1.1.1.1:443>
        ServerName server.yourhost.com
        ServerAlias www.server.yourhost.com
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin webmaster@server.yourhost.com
        UseCanonicalName off     
        UserDir public_html 
        <IfModule mod_suphp.c>          
            suPHP_UserGroup nobody nobody    
        </IfModule>
        ## User nobody # Needed for Cpanel::ApacheConf
        CustomLog /usr/local/apache/domlogs/server.yourhost.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
        ScriptAlias /cgi-bin/ /usr/local/apache/htdocs/cgi-bin/
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/server.yourhost.com.crt
        SSLCertificateKeyFile /etc/ssl/private/server.yourhost.com.key
        SSLCACertificateFile /etc/ssl/certs/server.yourhost.com.cabundle
        ErrorLog /usr/local/apache/domlogs/server.yourhost.com-ssl_data_log
        CustomLog /usr/local/apache/domlogs/server.yourhost.com-ssl_log combined
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    </VirtualHost> 
     
    </IfDefine>
    
     
Loading...

Share This Page