Skip to content

Instantly share code, notes, and snippets.

@1isten
Created December 1, 2018 17:57
Show Gist options
  • Save 1isten/2bf2896e35eaba28c07c07492ae2a673 to your computer and use it in GitHub Desktop.
Save 1isten/2bf2896e35eaba28c07c07492ae2a673 to your computer and use it in GitHub Desktop.
if certbot fail, get free ssl from https://freessl.cn/
<VirtualHost *:80 *:443>
ServerName www.853rd.com
ServerAlias 853rd.com
ServerAdmin [email protected]
DocumentRoot /var/www/853rd.com
<Directory "/var/www/853rd.com/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/www.853rd.com/full_chain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.853rd.com/private.key
Include /etc/letsencrypt/options-ssl-apache.conf
# RewriteEngine On
# RewriteCond %{SERVER_PORT} !^443$
# RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [R=301,L]
</VirtualHost>
/etc/letsencrypt/live/: drwx------ (700)
full_chain.pem: -rw-r--r-- (644)
private.key: -rw-r--r-- (644)
a2enmod ssl
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment