标签:配置 roo apache let service live MLOG var site
目的用Apache和let‘s encrypt配置SSL
Debian 9
Apache 2.4
$ sudo a2enmod socache_shmcb
$ sudo a2enmod ssl
下面命令生成证书。
$ sudo certbot certonly --webroot -w /var/www/html -d hogehoge.info
/var/www/html:DocumentRoot(文件根目录)
生成的证书的存放地址写在“IMPORTANT NOTES:”的下面。
例如:
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/hogehoge.info/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/hogehoge.info/privkey.pem
(接续)
debian版apache的conf在/etc/apache2/sites-enabled/目录。
写这个项目在<VirtualHost *:443>的下面
例如:
<VirtualHost *:443>
ServerAdmin hoge@hoge.com
DocumentRoot /var/www/html
ServerName hogehoge.info
ServerAlias 192.168.xx.xx
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/hogehoge.info/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hogehoge.info/privkey.pem
</VirtualHost>
$ sudo service apache2 restart
标签:配置 roo apache let service live MLOG var site
原文地址:http://blog.51cto.com/13853768/2351523