1)添加证书
我有添加了 SSL 证书对于子域名sm.webscraping.pro(VPS,Centos 7)在 VestaCP 使用让我们加密支持选项,见下文:
2)文件
这证书文件在目录中/home/admin/conf/web/
:
ssl.sm.webscraping.pro.ca
ssl.sm.webscraping.pro.crt
ssl.sm.webscraping.pro.key
ssl.sm.webscraping.pro.pem
同一目录下的文件sm.webscraping.pro.httpd.ssl.conf
内容如下:
<VirtualHost 185.221.154.249:8443>
ServerName sm.webscraping.pro
ServerAdmin [email protected]
DocumentRoot /home/admin/web/sm.webscraping.pro/public_html
ScriptAlias /cgi-bin/ /home/admin/web/sm.webscraping.pro/cgi-bin/
Alias /vstats/ /home/admin/web/sm.webscraping.pro/stats/
Alias /error/ /home/admin/web/sm.webscraping.pro/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/httpd/domains/sm.webscraping.pro.bytes bytes
CustomLog /var/log/httpd/domains/sm.webscraping.pro.log combined
ErrorLog /var/log/httpd/domains/sm.webscraping.pro.error.log
<Directory /home/admin/web/sm.webscraping.pro/public_html>
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes +ExecCGI
#php_admin_value open_basedir /home/admin/web/sm.webscraping.pro/public_html:/home/admin/tmp
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>
<Directory /home/admin/web/sm.webscraping.pro/stats>
AllowOverride All
</Directory>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /home/admin/conf/web/ssl.sm.webscraping.pro.crt
SSLCertificateKeyFile /home/admin/conf/web/ssl.sm.webscraping.pro.key
SSLCertificateChainFile /home/admin/conf/web/ssl.sm.webscraping.pro.ca
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups apache
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/shttpd.sm.webscraping.pro.conf*
</VirtualHost>
3)不工作:-(
4 检查证书
什么时候检查 SSL 证书,检查器返回与主域相关的 SSL 证书:
笔记:目前属于主域名的 SSL 证书不能同时用于该域名及其子域名。
有什么建议吗?缺少了什么吗?
更新
旁/home/admin/conf/web/sm.webscraping.pro.httpd.ssl.conf
,[自动生成] 文件,我之前已经为 80 和 443 端口设置了虚拟主机:
/etc/httpd/conf/httpd.conf
<VirtualHost *:80>
DocumentRoot /home/admin/web/sm.webscraping.pro/public_html/public
ServerName sm.webscraping.pro
</VirtualHost>
<VirtualHost *:443>
ServerName sm.webscraping.pro
DocumentRoot /home/admin/web/sm.webscraping.pro/public_html/public
SSLEngine On
SSLCertificateFile /etc/dehydrated/certs/sm.webscraping.pro/cert.pem
SSLCertificateKeyFile /etc/dehydrated/certs/sm.webscraping.pro/privkey.pem
SSLCertificateChainFile /etc/dehydrated/certs/sm.webscraping.pro/fullchain.pem
</VirtualHost>