Fli
09-26-2016, 09:14 PM
On zPanel CentOS 6.x server i installed LetsEncrypt SSL manually via command line. I do not guarantee it will work for anyone.
1. install cert bot: https://certbot.eff.org/
2. run certbot:
/certbot-auto certonly --email [email protected] --agree-tos --apache -d mydomain.com -d www.mydomain.com (http://www.mydomain.com)
it should tell something like:
Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/mydomain.com/fullchain.pem.
3. paste following code into file /etc/httpd/conf.d/mydomain.conf
<VirtualHost mydomain.com:443>
SSLEngine on
ServerName mydomain.com
ServerAlias www.mydomain.com (http://www.mydomain.com)
DocumentRoot /var/zpanel/hostdata/zadmin/public_html/mydomain_com
ErrorLog /var/zpanel/hostdata/zadmin/public_html/mydomain_com/httpd_error_log
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/mydomain.com/chain.pem
</VirtualHost>
(replacing mydomain or mydomain_com by your domain name, making sure DocumentRoot exist and contains website files and if you do not use zPanel, then use different DocumentRoot)
4. restart apache: service httpd restart
5. setup cronjob to renews SSL automatically:
crontab -e
add to the end of file:
@daily /bin/sh /certbot-auto renew
----
If after page refresh (Ctrl+F5) on zpanel login page you can not login, revert changes and try to follow: http://forums.sentora.org/showthread.php?tid=1183&pid=7743#pid7743
1. install cert bot: https://certbot.eff.org/
2. run certbot:
/certbot-auto certonly --email [email protected] --agree-tos --apache -d mydomain.com -d www.mydomain.com (http://www.mydomain.com)
it should tell something like:
Congratulations! Your certificate and chain have been saved at
/etc/letsencrypt/live/mydomain.com/fullchain.pem.
3. paste following code into file /etc/httpd/conf.d/mydomain.conf
<VirtualHost mydomain.com:443>
SSLEngine on
ServerName mydomain.com
ServerAlias www.mydomain.com (http://www.mydomain.com)
DocumentRoot /var/zpanel/hostdata/zadmin/public_html/mydomain_com
ErrorLog /var/zpanel/hostdata/zadmin/public_html/mydomain_com/httpd_error_log
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/mydomain.com/chain.pem
</VirtualHost>
(replacing mydomain or mydomain_com by your domain name, making sure DocumentRoot exist and contains website files and if you do not use zPanel, then use different DocumentRoot)
4. restart apache: service httpd restart
5. setup cronjob to renews SSL automatically:
crontab -e
add to the end of file:
@daily /bin/sh /certbot-auto renew
----
If after page refresh (Ctrl+F5) on zpanel login page you can not login, revert changes and try to follow: http://forums.sentora.org/showthread.php?tid=1183&pid=7743#pid7743