HTTPSはexample.comでは機能せず、www.example.comでのみ機能します。

HTTPSはexample.comでは機能せず、www.example.comでのみ機能します。

私はWebサーバーにSSL証明書をインストールし、certbotを使用してすべてのhttpリクエストをhttpsにリダイレクトしています。これまでは、example.comを使用せずにwww.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を使用して同じカールコマンドを実行すると、私のウェブサイトに移動します。使っています

-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.

ベストアンサー1

おすすめ記事