我已在网络服务器上安装了 SSL 证书,并使用 certbot 将所有 http 请求重定向到 https。到目前为止,当我尝试打开 www.example.com 但不使用 example.com 时,这是有效的。仅供记录,我已将我的domain.com 更改为example.com。当我尝试在浏览器中打开 example.com 时,我检查了我的access_log
和所有这些都没有显示任何新条目。error.log
curl https://example.com
curl: (60) Issuer certificate is invalid.
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
当我使用 www.example.com 执行相同的curl命令时,我进入了我的网站。我在用
-bash-4.2$ hostname
example
-bash-4.2$ hostname -f
example.com
我的主机名/etc/sysconfig/network
是示例。我还使用虚拟主机文件:
cat /etc/httpd/sites-available/example.conf
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/html
ErrorLog /var/www/html/error.log
CustomLog /var/www/html/requests.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.example.com [OR]
RewriteCond %{SERVER_NAME} =example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
在 httpd.conf 中我已设置从加载配置文件/etc/httpd/sites-available/*.conf
另一个问题是,当我尝试安装 Cpanel 时,出现以下错误:
2017-03-15 14:10:39 501 ( INFO): Validating that the system hostname ('example') is a FQDN...
2017-03-15 14:10:39 507 (ERROR):
2017-03-15 14:10:39 508 (ERROR): ********************* ERROR *********************
2017-03-15 14:10:39 509 (ERROR):
2017-03-15 14:10:39 510 (ERROR): Your hostname (example) is invalid, and must be
2017-03-15 14:10:39 511 (ERROR): set to a fully qualified domain name before installing cPanel.
2017-03-15 14:10:39 512 (ERROR):
2017-03-15 14:10:39 513 (ERROR): A fully qualified domain name must contain two dots, and consists of two parts: the hostname and the domain name.
2017-03-15 14:10:39 514 (ERROR): You can update your hostname by running `hostname your-hostname.example.com`, then re-running the installer.
2017-03-15 14:10:39 516 (ERROR): ********************* ERROR *********************
2017-03-15 14:10:39 517 (FATAL): Exiting...
Removing /root/installer.lock.