小标
2018-08-30
来源 :
阅读 2142
评论 0
摘要:本文主要向大家介绍了Linux运维知识之linux使用certbot 自己生成证书apache版,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
本文主要向大家介绍了Linux运维知识之linux使用certbot 自己生成证书apache版,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
1.获取certbot-auto
wget https://dl.eff.org/certbot-auto
2.添加执行权限
chmod a+x certbot-auto
3.自动下载和安装环境需要的组件
./certbot-auto --apache certonly
4.生成域名所需要的证书(红色部分为网站访问的路径和需要生成证书的域名)
./certbot-auto certonly --email 123456@qq.com --agree-tos --webroot -w /www/web/blxz/public_html -d blxz.qq.cn
5.生成的路径应该是(应该是四个证书文件):
/etc/letsencrypt/live/blxz.qq.com/privkey.pem
6.配置apache文件(vhost的域名配置文件.conf)
DocumentRoot /www/web/blxz/public_html
ServerName blxz.qq.com
ServerAlias blxz.qq.com
ErrorDocument 400 /errpage/400.html
ErrorDocument 403 /errpage/403.html
ErrorDocument 404 /errpage/404.html
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/blxz.qq.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blxz.qq.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/blxz.qq.com/chain.pem
php_admin_value open_basedir /www/web/blxz:/tmp
DeflateCompressionLevel 7
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css js html htm gif jpg png bmp php
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
7.重启apache配置
service httpd restart
注意:certbot Let‘s Encrypt永久免费但需要90天激活一次续约
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注系统运维Linux频道!
喜欢 | 0
不喜欢 | 0
您输入的评论内容中包含违禁敏感词
我知道了

请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式AI+学习就业服务平台 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号