SSL travando o Apache (falha ao carregar)

1

Ao tentar usar o meu SSL no Apache2 (Ubuntu 17), parece que o Apache foi quebrado.

Erro do console

    ● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Thu 2018-05-03 11:52:21 AEST; 2h 4min ago
  Process: 3366 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
      CPU: 85ms

May 03 11:52:20 FRAFFEL_MEDIA systemd[1]: Starting The Apache HTTP Server...
May 03 11:52:21 FRAFFEL_MEDIA apachectl[3366]: AH00558: apache2: Could not reliably determine the server's fully qualifi
May 03 11:52:21 FRAFFEL_MEDIA apachectl[3366]: Action 'start' failed.
May 03 11:52:21 FRAFFEL_MEDIA apachectl[3366]: The Apache error log may have more information.
May 03 11:52:21 FRAFFEL_MEDIA systemd[1]: apache2.service: Control process exited, code=exited status=1
May 03 11:52:21 FRAFFEL_MEDIA systemd[1]: Failed to start The Apache HTTP Server.
May 03 11:52:21 FRAFFEL_MEDIA systemd[1]: apache2.service: Unit entered failed state.
May 03 11:52:21 FRAFFEL_MEDIA systemd[1]: apache2.service: Failed with result 'exit-code'.

/ var / log / apache2 / error_log:

[Thu May 03 06:25:01.830302 2018] [mpm_prefork:notice] [pid 4511] AH00163: Apache/2.4.25 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Thu May 03 06:25:01.830372 2018] [core:notice] [pid 4511] AH00094: Command line: '/usr/sbin/apache2'
[Thu May 03 08:03:44.188546 2018] [:error] [pid 13778] [client 95.213.177.126:63358] script '/var/www/404/azenv.php' not found or unable to stat, referer: https://proxyradar.com/
[Thu May 03 11:29:21.335601 2018] [mpm_prefork:notice] [pid 4511] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using fe80::f03c:91ff:fea7:2ab8. Set the 'ServerName' directive globally to suppress this message
[Thu May 03 11:29:21.424519 2018] [ssl:warn] [pid 4511] AH01909: fe80::f03c:91ff:fea7:2ab8:80:0 server certificate does NOT include an ID which matches the server name
[Thu May 03 11:29:21.424615 2018] [ssl:emerg] [pid 4511] AH02569: Illegal attempt to re-initialise SSL for server (SSLEngine On should go in the VirtualHost, not in global scope.)
[Thu May 03 11:29:21.424621 2018] [:emerg] [pid 4511] AH00020: Configuration Failed, exiting
[Thu May 03 11:36:17.850289 2018] [ssl:warn] [pid 3415] AH01909: 2600:3c01::f03c:91ff:fea7:2ab8:80:0 server certificate does NOT include an ID which matches the server name
[Thu May 03 11:36:17.851117 2018] [ssl:emerg] [pid 3415] AH02569: Illegal attempt to re-initialise SSL for server (SSLEngine On should go in the VirtualHost, not in global scope.)
AH00016: Configuration Failed
[Thu May 03 11:52:21.316911 2018] [ssl:warn] [pid 3393] AH01909: fe80::f03c:91ff:fea7:2ab8:80:0 server certificate does NOT include an ID which matches the server name
[Thu May 03 11:52:21.323098 2018] [ssl:emerg] [pid 3393] AH02569: Illegal attempt to re-initialise SSL for server (SSLEngine On should go in the VirtualHost, not in global scope.)
AH00016: Configuration Failed

Não tenho certeza do que está acontecendo, pois isso só acontece quando o SSL é usado nos sites disponíveis config:

<virtualhost *:443> 
ServerName fraffel.tech 
DocumentRoot /var/www/fraffeltech
</virtualhost>

SSLEngine on 
SSLCertificateFile /etc/ssl/fraffel_tech.crt 
SSLCertificateKeyFile /etc/ssl/private/fraffel.tech.key 
SSLCertificateChainFile /etc/ssl/fraffel_tech.ca-bundle 

Os arquivos SSL estão nesses diretórios, mas não tenho certeza do que está acontecendo e, sim, o mod ssl está ativado ...

    
por FRAFFEL MEDIA 03.05.2018 / 06:03

1 resposta

1

Altere seu virtualhost para

<VirtualHost *:443> 
    ServerName fraffel.tech 
    DocumentRoot /var/www/fraffeltech

    SSLEngine on 
    SSLCertificateFile /etc/ssl/fraffel_tech.crt 
    SSLCertificateKeyFile /etc/ssl/private/fraffel.tech.key 
    SSLCertificateChainFile /etc/ssl/fraffel_tech.ca-bundle 
</VirtualHost>

A dica é esta:

[Thu May 03 11:36:17.851117 2018] [ssl:emerg] [pid 3415] AH02569: Illegal attempt to re-initialise SSL for server (SSLEngine On should go in the VirtualHost, not in global scope.)

Além disso, há uma mensagem de aviso, que você diz:

Could not reliably determine the server's fully qualified domain name, using fe80::f03c:91ff... Set the 'ServerName' directive globally to suppress this message

Defina a diretiva 'ServerName' globalmente para suprimir essa mensagem significa que você deve ter uma diretiva ServerName fora das tags <VirtualHost> . Pode ser o nome do seu domínio principal ou apenas localhost :

ServerName fraffel.tech 

<VirtualHost *:443> 
    ServerName fraffel.tech 
    DocumentRoot /var/www/fraffeltech

    #...
</VirtualHost>
    
por vidarlo 03.05.2018 / 07:06