In this post I’ll Show YOU
[b:a79777a22c] HOW TO GET SHARED SSL WORKING (in a Step-By-Step instruction)[/b:a79777a22c]
I do not describe how to generate SSL keys most of you know it, just focus on installing Shared SSL and get it working
There are two major methods of offering shared SSL
A) User Directory Shared SSL https://host.server.com/~user/
B) Subdomain Shared SSL https://user.server.com
Also you have to have these modules for apache, mod_bwlimited & mod_bwprotect to save your bandwidth
Read this thread I wrote everything about bandwidth saving issues
http://forums.cpanel.net/read.php?TID=3259
For this purpose you should re-install buildapache.sea by using
/scripts/easyapache
select advanced
then select these modules
(*) User bandwidth leech protection
(*) Bytes logging Module
(*) Frontpage Module
(*) Raise HARD_SERVER_LIMIT
(*) Rewrite Module
(*) SSL Module
(*) suEXEC Module
[b:a79777a22c]A) User Directory Shared SSL https://host.server.com/~user/ [/b:a79777a22c]
1- in WHM -& SSL/TLS -& Install SSL Certificate
paste your server certificate, private key & CA's public key (is required for some of certificates) wait until cpanel shows you the domain and IP of your Server certificate’s FQDN
Note: If you generated the certificate using WebHost Manager, the certificate files will be available. Refer to Generate an SSL certificate for more information.
Enter your FQDN in Domain field and press fetch button
[b:a79777a22c] WHAT is FQDN ?[/b:a79777a22c] FQDN stands for Fully Qualified Domain Name which is something like this host.serverdomain.com, please be careful SSL certificates should be generated for FQDN not just a domain (domain: domain.com, FQDN: host.domain.com)
[b:a79777a22c] Attention: You have to use HOST.SERVERDOMAIN.COM[/b:a79777a22c]
in a Root SSH session type this command
[email protected] [~]# [b:a79777a22c] hostname
the FQDN that you should use for Shared SSL is the result of above command [/b:a79777a22c]
enter your commercial domain’s Username in the Username field do not enter root or nobody we will modify this later.
press “Do it” installation will be finished by restarting Apache
2- Find these lines in your httpd.conf use pico /etc/httpd/conf/httpd.conf in a Root SSH session (these lines are at the near end of the file)
Note: 10.20.30.40 is your server’s IP, host.serverdomain.com is your server’s FQDN and username is your username
[quote:a79777a22c]
&IfDefine SSL&
&VirtualHost 10.20.30.40:443&
ServerAdmin
[email protected]
DocumentRoot /home/username/public_html
ServerName host.serverdomain.com
CustomLog /usr/local/apache/domlogs/host.serverdomain.com-ssl_log &%t %{version}c %{cipher}c %{clientcert}c&
SSLEnable
SSLCertificateFile /usr/share/ssl/certs/host.serverdomain.com.crt
SSLCertificateKeyFile /usr/share/ssl/private/host.serverdomain.com.key
SSLCACertificateFile /usr/share/ssl/certs/host.serverdomain.com.cabundle
SSLLogFile /var/log/host.serverdomain.com
UserDir public_html
ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/
SetEnvIf User-Agent &.*MSIE.*& nokeepalive ssl-unclean-shutdown
&/VirtualHost&
&/IfDefine&
[/quote:a79777a22c]
Now it’s time to modify the block, bold text should be modified as you see exactly in this quotation
Note: don’t forget to put # mark in front of UserDir and ScriptAlias lines or modify them as you need to show something more than &HEY, it worked!& page when someone type https://host.domainserver.com, but these settings do not affect on https://host.domainserver.com/~user/
[quote:a79777a22c]
&IfDefine SSL&
&VirtualHost 10.20.30.40:443&
[b:a79777a22c] ServerAdmin
[email protected] [/b:a79777a22c]
[b:a79777a22c] DocumentRoot /usr/local/apache/htdocs [/b:a79777a22c]
ServerName host.serverdomain.com
CustomLog /usr/local/apache/domlogs/host.serverdomain.com-ssl_log &%t %{version}c %{cipher}c %{clientcert}c&
SSLEnable
SSLCertificateFile /usr/share/ssl/certs/host.serverdomain.com.crt
SSLCertificateKeyFile /usr/share/ssl/private/host.serverdomain.com.key
SSLCACertificateFile /usr/share/ssl/certs/host.serverdomain.com.cabundle
SSLLogFile /var/log/host.serverdomain.com
[b:a79777a22c]# UserDir public_html
# ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/ [/b:a79777a22c]
SetEnvIf User-Agent &.*MSIE.*& nokeepalive ssl-unclean-shutdown
&/VirtualHost&
&/IfDefine&
[/quote:a79777a22c]
3- Restart Apache
[b:a79777a22c] You have to do this installation one time then all of accounts on your server have SSL access without any modification. [/b:a79777a22c]
Now your https://host.serverdomain.com should shows your “HEY, it Worked page!” and shared SSL is working fine using
https://host.serverdomain.com/~user/
[b:a79777a22c] CGI / PHP scripts [/b:a79777a22c]
Some of CGI and PHP scripts split the paths from your address bar they use relative address (URL), you have to make a second copy of them and change relative paths or configurations for secure usage .
[b:a79777a22c] B) Subdomain Shared SSL https://user.server.com [/b:a79777a22c]
Subdomain shared SSL has similar procedures but you need to buy wildcard certificate, and create a subdomain for each user
I do not recommend to use subdomain shared SSL if you don’t charge your customers about SSL feature because “wildcard SSL web Certificate” is more expensive than single web certificate and you have to do some parts of installation procedures manually on a per user basis or write you own scripts
[b:a79777a22c] How to Remove SSL certs and Keys? [/b:a79777a22c]
If you want to remove an installed SSL for example for the host.domain.com you should remove
Certificates are at this directory:
/usr/share/ssl/certs/
remove these files:
host.domain.com.crt
host.domain.com.cabundle (if available)
Private keys are at this directory:
/usr/share/ssl/private/
remove this file:
host.domain.com.key
Also you have to remove the related block in httpd.conf
&IfDefine SSL&
&VirtualHost 10.20.30.40:443&
……
&/VirtualHost&
&/IfDefine&
[b:a79777a22c] How to test before buy a Certificate
or
Installing fake SSL Web Certificate [/b:a79777a22c]
You can create fake web certificate and install it for testing purposes if you don’t know how to create a fake certificate go to this URL and create one for testing purposes only
http://snakeoil.haisee.com/freecerts.php
[b:a79777a22c]Attention: Fake web certificates are not trusted in client browsers, also there are some legal issues with them (they are illegal in production environments) Thus Never use fake certificates for production environments.[/b:a79777a22c]