Difference between revisions of "Sentora SSL Letsencrypt"

From MS Computech
Jump to: navigation, search
Line 13: Line 13:
 
./letsencrypt-auto --help
 
./letsencrypt-auto --help
 
service httpd stop
 
service httpd stop
./letsencrypt-auto certonly --standalone -d domain.com -d www.domain.com
+
./letsencrypt-auto certonly --standalone -d domain.com -d www.domain.com -d images.domain.com -d panel.domain.com
 
service httpd start
 
service httpd start
 
</pre>
 
</pre>
Line 39: Line 39:
 
service apache2 restart
 
service apache2 restart
 
</pre>
 
</pre>
 +
 +
Rewrite .htaccess http to https
 +
<pre>
 +
RewriteEngine On
 +
 +
# If your opencart installation does not run on the main web folder make sure y$
 +
 +
RewriteBase /
 +
 +
####################
 +
#First rewrite any request to the wrong domain to use the correct one (here www$
 +
RewriteCond %{HTTP_HOST} !^www\.
 +
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 +
 +
#Now, rewrite to HTTPS:
 +
RewriteCond %{HTTPS} off
 +
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 +
<pre>
  
 
Your domain should now be secured by SSL.
 
Your domain should now be secured by SSL.
 
You can test it here: https://www.ssllabs.com/ssltest/
 
You can test it here: https://www.ssllabs.com/ssltest/

Revision as of 10:17, 21 January 2017

วิธีการติดตั้ง SSL Letsencrypt บน Centos 7 Sentora

yum install git mod_ssl openssl python-certbot-apache
nano /etc/httpd/conf.d/ssl.conf

nano /etc/httpd/conf.d/ssl.conf

#Listen 443 https
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto --help
service httpd stop
./letsencrypt-auto certonly --standalone -d domain.com -d www.domain.com -d images.domain.com -d panel.domain.com
service httpd start

Changing Sentora port: On Sentora Panel go to Admin -> Module Admin -> Apache Config > Override a Virtualhost [Select VHost] -> Tick Port Override. Forward Port 80 to Overriden Port: 443 Custom Entry:

SSLEngine on
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
SSLCertificateFile /etc/letsencrypt/live/domain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/domain.com/chain.pem
# Keeping bellow for future upgrades.
# Requires Apache >= 2.4
SSLCompression off
php -q /etc/sentora/panel/bin/daemon.php
service apache2 restart

Rewrite .htaccess http to https

RewriteEngine On

# If your opencart installation does not run on the main web folder make sure y$

RewriteBase /

####################
#First rewrite any request to the wrong domain to use the correct one (here www$
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#Now, rewrite to HTTPS:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<pre>

Your domain should now be secured by SSL.
You can test it here: https://www.ssllabs.com/ssltest/