HTTPS não funciona para example.com, apenas para www.example.com

1

Eu instalei o certificado SSL no meu servidor e habilitei o redirecionamento de todas as solicitações http para https usando o certbot. Até agora, isso funciona quando eu tento abrir www.example.com, mas não com example.com. Apenas para o registro eu mudei meu domain.com com example.com. Eu verifiquei meu access_log e error.log e todos eles não mostram novas entradas quando tento abrir example.com em um navegador.

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.

Quando executo o mesmo comando curl com www.example.com, chego ao meu site. Estou usando

-bash-4.2$ hostname
example
-bash-4.2$ hostname -f
example.com

Meu nome de host em /etc/sysconfig/network é um exemplo. Eu também estou usando o arquivo vhost:

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>

e no httpd.conf eu configurei para carregar arquivos de configuração de /etc/httpd/sites-available/*.conf

O outro problema é que quando tento instalar o Cpanel, ocorre o seguinte erro:

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.
    
por Georgе Stoyanov 15.03.2017 / 16:01

0 respostas