Letsencrypt SSL Installation for Hostname – How to guide

1st you need to add the subdomain to your DNS manager and point it to the server, also you need to add the sudomain through Vhost by adding bellow lines to the new file /usr/local/apache/conf.d/vhosts-hostname.conf

# vhost_start host.hostname.com
<VirtualHost SERVER-IP:80>
ServerName host.hostname.com
ServerAlias www.host.hostname.com
ServerAdmin xyz@mail.com
DocumentRoot "/usr/local/apache/htdocs/"

<IfModule mod_suexec.c>
        SuexecUserGroup nobody nobody
</IfModule>

<IfModule mod_suphp.c>
        suPHP_UserGroup nobody nobody
</IfModule>

<Directory "/usr/local/apache/htdocs">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end host.hostname.com

Don’t forget to replace the hostname and the server Ip with yours, after adding this lines restart the apache

service httpd restart

and check if the subdomain is showing apache default page, if it shows the default page then navigate to 2nd step
please note : subdomain and the hostname should be the same.

2nd
You need to go to lentsencrypt manager (install it)

go to “Custom Install of Letsencrypt”

and fill the details as follows :
Domain : host.hostname.com
Path : /usr/local/apache/htdocs/
UserName : nobody
Email : youremail@xyz.com
IP : your Server IP
Port : 443

hit install ssl

3rd
go to /usr/local/cwpsrv/conf.d/ and edit cwp-ssl.conf replace all with below lines :

Listen 2031

<VirtualHost SERVER-IP:2031>
        ServerName SERVER-IP
        SSLEngine on
 SSLCertificateFile /etc/letsencrypt/live/host.hostname.com/cert.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/host.hostname.com/privkey.pem
 SSLCertificateChainFile /etc/letsencrypt/live/host.hostname.com/fullchain.pem
 SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>

Don’t forget to replace the hostname and the server Ip with your server details
save and restart cwp

service cwpsrv restart

Video instructions