Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#26 Le 28/10/2022, à 17:26

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Dans le point 2.3 de la doc
je comprend que la config  :80   et  :443   sont dans le meme fichier de conf ???
la doc est bien celle à suivre ...  je ne dois donc PAS tenir compte du fichier nextcloud-le-ssl.conf ?
J'adapte ma config uniquement avec le fichier   nextcloud.conf ?

Dernière modification par waca (Le 28/10/2022, à 17:29)

Hors ligne

#27 Le 28/10/2022, à 19:02

bruno

Re : [Résolu] Apache2 (l'appli) ne démarre plus

La doc ubuntu-fr (faites par des bénévoles) n'est pas forcément complète ni à jour.
Le fichier que tu cites a probablement été créé et activé par certbot. Tu dois le savoir c'est toi qui a lancé la commande et répondu aux questions.
Donc oui il faut probablement en tenir compte. Il suffit d'examiner tes fichiers de configuration pour comprendre qui sert à quoi.


Attention, les bouteilles vendues par Nestlé Waters sont contaminées au monoxyde de dihydrogène.

Hors ligne

#28 Le 29/10/2022, à 02:20

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Ahouuu, je retombe sur le  #22  sad 

Le site

nextcloud.conf

<VirtualHost *:80>
    ServerName cloud.maxitag.net
    ServerAlias cloud.maxitag.net
    ServerAdmin webmaster@maxitag.net
    # Redirection 301  vers le site en HTTPS
    Redirect permanent / https://cloud.maxitag.net/
</VirtualHost>

nextcloud-le-ssl.conf

<VirtualHost *:443>
ServerName cloud.maxitag.net
    ServerAlias cloud.maxitag.net
    ServerAdmin webmaster@maxitag.net
    DocumentRoot /var/www/nextcloud
        <Directory /var/www/nextcloud>
                Options -Indexes +FollowSymLinks +MultiViews
                AllowOverride none
                Require all granted
        </Directory>

       # directives obligatoires pour TLS
        SSLEngine on
        Include    /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/cloud.maxitag.net/privkey.pem

        Header always set Strict-Transport-Security "max-age=15768000"

        ErrorLog /var/log/apache2/error.cloud.maxitag.net.log
        CustomLog /var/log/apache2/access.cloud.maxitag.net.log combined
</VirtualHost>
ubuntu@141:~$ sudo systemctl reload apache2 
Job for apache2.service failed. 
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details. 

Je ne vois toujours pas ce que  cpanel  vient faire ici... je n'ai pas de config avec ce dns

ubuntu@141:~$ systemctl status apache2.service 
● apache2.service - The Apache HTTP Server 
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) 
Active: active (running) since Fri 2022-10-28 19:20:25 +11; 14h ago 
Docs: https://httpd.apache.org/docs/2.4/ 
Process: 30922 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=1/FAILURE) 
Main PID: 20991 (apache2) 
Tasks: 11 (limit: 28694) 
Memory: 68.6M 
CPU: 21.689s 
CGroup: /system.slice/apache2.service 
├─20991 /usr/sbin/apache2 -k start 
├─25019 /usr/sbin/apache2 -k start 
├─25020 /usr/sbin/apache2 -k start 
├─25021 /usr/sbin/apache2 -k start 
├─25022 /usr/sbin/apache2 -k start 
├─25023 /usr/sbin/apache2 -k start 
├─25024 /usr/sbin/apache2 -k start 
├─25027 /usr/sbin/apache2 -k start 
├─26051 /usr/sbin/apache2 -k start 
├─29055 /usr/sbin/apache2 -k start 
└─29065 /usr/sbin/apache2 -k start 
Oct 29 02:07:15 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: Reloading The Apache HTTP Server... 
Oct 29 02:07:15 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: Reloaded The Apache HTTP Server. 
Oct 29 02:12:20 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: Reloading The Apache HTTP Server... 
Oct 29 02:12:21 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: Reloaded The Apache HTTP Server. 
Oct 29 09:34:53 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: Reloading The Apache HTTP Server... 
Oct 29 09:34:53 141.145.209.128cpanel.maxitag.netcpanel apachectl[30925]: apache2: Syntax error on line 225> 
Oct 29 09:34:53 141.145.209.128cpanel.maxitag.netcpanel apachectl[30922]: Action 'graceful' failed. 
Oct 29 09:34:53 141.145.209.128cpanel.maxitag.netcpanel apachectl[30922]: The Apache error log may have mor> 
Oct 29 09:34:53 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: apache2.service: Control process exited> 
Oct 29 09:34:53 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: Reload failed for The Apache HTTP Serve> 
ubuntu@141:~$ apachectl configtest 
AH00526: Syntax error on line 15 of /etc/apache2/sites-enabled/nextcloud-le-ssl.conf: 
SSLCertificateFile: file '/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem' does not exist or is empty 
Action 'configtest' failed. 
The Apache error log may have more information.
ubuntu@141:~$ sudo ls -l /etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem 
lrwxrwxrwx 1 root root 46 oct. 29 02:17 /etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem -> ../../arch 
ive/cloud.maxitag.net/fullchain4.pem 
ubuntu@141:~$ ls -l /etc/letsencrypt/archive/cloud.maxitag.fr/fullchain4.pem 
ls: cannot access '/etc/letsencrypt/archive/cloud.maxitag.fr/fullchain4.pem': No such file or directory 
ubuntu@141:~$ chmod a+rX /etc/letsencrypt/archive/
ubuntu@141:~$ sudo systemctl restart apache2 
ubuntu@141:~$ openssl s_client -connect cloud.maxitag.net:443 
CONNECTED(00000003) 
20F05EB5FFFF0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record. 
c:354: 
--- 
no peer certificate available 
--- 
No client certificate CA names sent 
--- 
SSL handshake has read 5 bytes and written 319 bytes 
Verification: OK 
--- 
New, (NONE), Cipher is (NONE) 
Secure Renegotiation IS NOT supported 
Compression: NONE 
Expansion: NONE 
No ALPN negotiated 
Early data was not sent 
Verify return code: 0 (ok) 
ubuntu@141:~$ sudo ufw status 
État : actif 
Vers Action De 
---- ------ -- 
80/tcp ALLOW Anywhere 
443 ALLOW Anywhere 
80 ALLOW Anywhere 
22 ALLOW Anywhere 
443/tcp ALLOW Anywhere 
3389/tcp ALLOW Anywhere 
80 on eth0 ALLOW Anywhere 
443 on eth0 ALLOW Anywhere 
80,443/tcp ALLOW Anywhere 
21/tcp ALLOW Anywhere 
10000 ALLOW Anywhere 
80/tcp (v6) ALLOW Anywhere (v6) 
443 (v6) ALLOW Anywhere (v6) 
80 (v6) ALLOW Anywhere (v6) 
22 (v6) ALLOW Anywhere (v6) 
443/tcp (v6) ALLOW Anywhere (v6) 
3389/tcp (v6) ALLOW Anywhere (v6) 
80 (v6) on eth0 ALLOW Anywhere (v6) 
443 (v6) on eth0 ALLOW Anywhere (v6) 
80,443/tcp (v6) ALLOW Anywhere (v6) 
21/tcp (v6) ALLOW Anywhere (v6) 
10000 (v6) ALLOW Anywhere (v6) 

                                   

ubuntu@141:~$ namei -om /etc/letsencrypt/archive/cloud.maxitag.net/fullchain4.pem 
f: /etc/letsencrypt/archive/cloud.maxitag.net/fullchain4.pem 
drwxr-xr-x root root / 
drwxr-xr-x root root etc 
drwxr-xr-x root root letsencrypt 
drwxr-xr-x root root archive 
drwxr-xr-x root root cloud.maxitag.net 
-rw-r--r-- root root fullchain4.pem 
ubuntu@141:~$ apachectl configtest 
AH00526: Syntax error on line 15 of /etc/apache2/sites-enabled/nextcloud-le-ssl.conf: 
SSLCertificateFile: file '/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem' does not exist or is empty 
Action 'configtest' failed. 
The Apache error log may have more information.
ubuntu@141:~$ sudo apache2ctl -t 
Syntax OK 
ubuntu@141:~$ sudo apache2ctl -t -D DUMP_VHOSTS 
VirtualHost configuration: 
*:443 cloud.maxitag.net (/etc/apache2/sites-enabled/nextcloud-le-ssl.conf:1) 
*:80 cloud.maxitag.net (/etc/apache2/sites-enabled/nextcloud.conf:1) 
ubuntu@141:~$ sudo apache2ctl -M 
Loaded Modules: 
core_module (static) 
so_module (static) 
watchdog_module (static) 
http_module (static) 
log_config_module (static) 
logio_module (static) 
version_module (static) 
unixd_module (static) 
access_compat_module (shared) 
alias_module (shared) 
auth_basic_module (shared) 
authn_core_module (shared) 
authn_file_module (shared) 
authz_core_module (shared) 
authz_host_module (shared) 
authz_user_module (shared) 
autoindex_module (shared) 
deflate_module (shared) 
dir_module (shared) 
env_module (shared) 
filter_module (shared) 
headers_module (shared) 
mime_module (shared) 
mpm_prefork_module (shared) 
negotiation_module (shared) 
php_module (shared) 
proxy_module (shared) 
proxy_fcgi_module (shared) 
reqtimeout_module (shared) 
rewrite_module (shared) 
setenvif_module (shared) 
socache_shmcb_module (shared) 
ssl_module (shared) 
status_module (shared) 
ubuntu@141:~$ sudo chmod a+rX /etc/letsencrypt/archive/ 
ubuntu@141:~$ sudo systemctl restart apache2 
ubuntu@141:~$ gnutls-cli cloud.maxitag.net 
Processed 127 CA certificate(s). 
Resolving 'cloud.maxitag.net:443'... 
Connecting to '141.145.209.128:443'... 
|<1>| Received record packet of unknown type 72 
*** Fatal error: An unexpected TLS packet was received.
ubuntu@141:~$ echo | openssl s_client -connect cloud.maxitag.net:443 
CONNECTED(00000003) 
20805D87FFFF0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record. 
c:354: 
--- 
no peer certificate available 
--- 
No client certificate CA names sent 
--- 
SSL handshake has read 5 bytes and written 319 bytes 
Verification: OK 
--- 
New, (NONE), Cipher is (NONE) 
Secure Renegotiation IS NOT supported 
Compression: NONE 
Expansion: NONE 
No ALPN negotiated 
Early data was not sent 
Verify return code: 0 (ok) 
ubuntu@141:~$ curl -iv https://cloud.maxitag.net 
* Trying 141.145.209.128:443... 
* Connected to cloud.maxitag.net (141.145.209.128) port 443 (#0) 
* ALPN, offering h2 
* ALPN, offering http/1.1 
* CAfile: /etc/ssl/certs/ca-certificates.crt 
* CApath: /etc/ssl/certs 
* TLSv1.0 (OUT), TLS header, Certificate Status (22): 
* TLSv1.3 (OUT), TLS handshake, Client hello (1): 
* (5454) (IN), , Unknown (72): 
* error:0A00010B:SSL routines::wrong version number 
* Closing connection 0 
curl: (35) error:0A00010B:SSL routines::wrong version number 
ubuntu@141:~$ sudo apachectl -S 
VirtualHost configuration: 
*:443 cloud.maxitag.net (/etc/apache2/sites-enabled/nextcloud-le-ssl.conf:1) 
*:80 cloud.maxitag.net (/etc/apache2/sites-enabled/nextcloud.conf:1) 
ServerRoot: "/etc/apache2" 
Main DocumentRoot: "/var/www/html" 
Main ErrorLog: "/var/log/apache2/error.log" 
Mutex ssl-stapling: using_defaults 
Mutex proxy: using_defaults 
Mutex ssl-cache: using_defaults 
Mutex default: dir="/var/run/apache2/" mechanism=default 
Mutex mpm-accept: using_defaults 
Mutex watchdog-callback: using_defaults 
Mutex rewrite-map: using_defaults 
Mutex ssl-stapling-refresh: using_defaults 
PidFile: "/var/run/apache2/apache2.pid" 
Define: DUMP_VHOSTS 
Define: DUMP_RUN_CFG 
User: name="www-data" id=33 
Group: name="www-data" id=33 
ubuntu@141:/var/www/html$ curl -I 141.145.209.128/index.html 
HTTP/1.1 301 Moved Permanently 
Date: Fri, 28 Oct 2022 23:49:51 GMT 
Server: Apache/2.4.52 (Ubuntu) 
Location: https://cloud.maxitag.net/index.html 
Content-Type: text/html; charset=iso-8859-1 

Dernière modification par waca (Le 29/10/2022, à 02:32)

Hors ligne

#29 Le 29/10/2022, à 07:12

bruno

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Bon c'est bizarre tourt cela.

J'ai vérifié que les fichiers de certificat soient accessible uniquement à root n'est pas un problème. Donc désolé pour la fausse piste sur les droits des fichiers .pem.

Cependant, les commandes apachectl configtest ou apache2ctl -t , qui sont strictement équivalentes, indiquent bien une erreur mais elle devraient être passées en tant que root (avec sudo) pour éviter justement les problème de droits d'accès sur les fichiers lisibles uniquement par root.

Les tests avec openssl indiquent bien un problème de configuration du serveur.

On va donc reprendre avec les retours uniquement de ces commandes :

sudo systemctl restart apache2
sudo apache2ctl -t

Attention, les bouteilles vendues par Nestlé Waters sont contaminées au monoxyde de dihydrogène.

Hors ligne

#30 Le 29/10/2022, à 07:56

matrix-bx

Re : [Résolu] Apache2 (l'appli) ne démarre plus

waca a écrit :
ubuntu@141:~$ apachectl configtest 
AH00526: Syntax error on line 15 of /etc/apache2/sites-enabled/nextcloud-le-ssl.conf: 
SSLCertificateFile: file '/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem' does not exist or is empty                               <=======
Action 'configtest' failed. 
The Apache error log may have more information.
ubuntu@141:~$ gnutls-cli cloud.maxitag.net 
Processed 127 CA certificate(s). 
Resolving 'cloud.maxitag.net:443'... 
Connecting to '141.145.209.128:443'... 
|<1>| Received record packet of unknown type 72                                                                                                                  <=======
*** Fatal error: An unexpected TLS packet was received.                                                                                                       <=======
ubuntu@141:~$ echo | openssl s_client -connect cloud.maxitag.net:443 
CONNECTED(00000003) 
20805D87FFFF0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.                             <=======
c:354: 
--- 
...
ubuntu@141:~$ curl -iv https://cloud.maxitag.net 
* Trying 141.145.209.128:443... 
* Connected to cloud.maxitag.net (141.145.209.128) port 443 (#0) 
* ALPN, offering h2 
* ALPN, offering http/1.1 
* CAfile: /etc/ssl/certs/ca-certificates.crt 
* CApath: /etc/ssl/certs 
* TLSv1.0 (OUT), TLS header, Certificate Status (22): 
* TLSv1.3 (OUT), TLS handshake, Client hello (1): 
* (5454) (IN), , Unknown (72):                                                       <=======
* error:0A00010B:SSL routines::wrong version number                                   <=======
* Closing connection 0 
curl: (35) error:0A00010B:SSL routines::wrong version number                       <=======

Je pense qu'il faudrait peut-être se concentrer là dessus, le souci semble plutôt être dans la conf ssl/tls.
Je commencerais par arrêter apache, vérifier que plus rien n'écoute sur tcp/443, puis lancer openssl comme suit :

KEY=/etc/letsencrypt/live/cloud.maxitag.net/privkey.pem
CERT=/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem
sudo openssl s_server -key $KEY -cert $CERT -accept 443 -www

Puis

openssl s_client -connect cloud.maxitag.net:443
et/ou
gnutls-cli --ca-auto-retrieve cloud.maxitag.net

Dernière modification par matrix-bx (Le 29/10/2022, à 12:17)


Utilisations des balises de mises en formes.

Hors ligne

#31 Le 29/10/2022, à 11:24

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

ubuntu@141:~$ sudo systemctl restart apache2
ubuntu@141:~$ sudo apache2ctl -t
Syntax OK
ubuntu@141:~$ 
ubuntu@141:~$ sudo systemctl stop apache2
ubuntu@141:~$ sudo ss -tnlp
State     Recv-Q    Send-Q       Local Address:Port        Peer Address:Port    Process                                                                         
LISTEN    0         4096         127.0.0.53%lo:53               0.0.0.0:*        users:(("systemd-resolve",pid=971,fd=14))                                      
LISTEN    0         128                0.0.0.0:22               0.0.0.0:*        users:(("sshd",pid=1252,fd=3))                                                 
LISTEN    0         128              127.0.0.1:631              0.0.0.0:*        users:(("cupsd",pid=31427,fd=7))                                               
LISTEN    0         80               127.0.0.1:3306             0.0.0.0:*        users:(("mariadbd",pid=1234,fd=26))                                            
LISTEN    0         4096               0.0.0.0:111              0.0.0.0:*        users:(("rpcbind",pid=840,fd=4),("systemd",pid=1,fd=318))                      
LISTEN    0         4096               0.0.0.0:10000            0.0.0.0:*        users:(("miniserv.pl",pid=1447,fd=5))                                          
LISTEN    0         128                   [::]:22                  [::]:*        users:(("sshd",pid=1252,fd=4))                                                 
LISTEN    0         2                    [::1]:3350                [::]:*        users:(("xrdp-sesman",pid=1124,fd=7))                                          
LISTEN    0         128                  [::1]:631                 [::]:*        users:(("cupsd",pid=31427,fd=6))                                               
LISTEN    0         2                        *:3389                   *:*        users:(("xrdp",pid=1143,fd=11))                                                
LISTEN    0         4096                  [::]:111                 [::]:*        users:(("rpcbind",pid=840,fd=6),("systemd",pid=1,fd=320))                      
LISTEN    0         4096                  [::]:10000               [::]:*        users:(("miniserv.pl",pid=1447,fd=6))                                          
ubuntu@141:~$ 

Hors ligne

#32 Le 29/10/2022, à 11:52

bruno

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Ok pas d'erreur de syntaxe dans la configuration, par contre visiblement Apache refuse de démarrer (rien en écoute sur 80 et 443).
Il faut donc vérifier avec :

systemctl status apache2

Si cela ne suffit pas on regardera les logs d'erreur d'Apache : /var/log/apache2/error.cloud.maxitag.net.log et /var/log/apache2/error.log


Attention, les bouteilles vendues par Nestlé Waters sont contaminées au monoxyde de dihydrogène.

Hors ligne

#33 Le 29/10/2022, à 12:04

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Le résultat de sudo ss -tnlp a été obtenu après l'arrêt d'apache (comme l'a demandé matrix-bx)

Quand apache est lancé voici le résultat:

ubuntu@141:~$ sudo ss -tnlp
State         Recv-Q         Send-Q                 Local Address:Port                  Peer Address:Port        Process                                                                                                          
LISTEN        0              4096                   127.0.0.53%lo:53                         0.0.0.0:*            users:(("systemd-resolve",pid=971,fd=14))                                                                       
LISTEN        0              128                          0.0.0.0:22                         0.0.0.0:*            users:(("sshd",pid=1252,fd=3))                                                                                  
LISTEN        0              128                        127.0.0.1:631                        0.0.0.0:*            users:(("cupsd",pid=31427,fd=7))                                                                                
LISTEN        0              80                         127.0.0.1:3306                       0.0.0.0:*            users:(("mariadbd",pid=1234,fd=26))                                                                             
LISTEN        0              4096                         0.0.0.0:111                        0.0.0.0:*            users:(("rpcbind",pid=840,fd=4),("systemd",pid=1,fd=318))                                                       
LISTEN        0              4096                         0.0.0.0:10000                      0.0.0.0:*            users:(("miniserv.pl",pid=1447,fd=5))                                                                           
LISTEN        0              128                             [::]:22                            [::]:*            users:(("sshd",pid=1252,fd=4))                                                                                  
LISTEN        0              2                              [::1]:3350                          [::]:*            users:(("xrdp-sesman",pid=1124,fd=7))                                                                           
LISTEN        0              128                            [::1]:631                           [::]:*            users:(("cupsd",pid=31427,fd=6))                                                                                
LISTEN        0              511                                *:443                              *:*            users:(("apache2",pid=38147,fd=6),("apache2",pid=38073,fd=6),("apache2",pid=38071,fd=6),("apache2",pid=38070,fd=6),("apache2",pid=38069,fd=6),("apache2",pid=38068,fd=6),("apache2",pid=38067,fd=6),("apache2",pid=38066,fd=6))
LISTEN        0              2                                  *:3389                             *:*            users:(("xrdp",pid=1143,fd=11))                                                                                 
LISTEN        0              4096                            [::]:111                           [::]:*            users:(("rpcbind",pid=840,fd=6),("systemd",pid=1,fd=320))                                                       
LISTEN        0              511                                *:80                               *:*            users:(("apache2",pid=38147,fd=4),("apache2",pid=38073,fd=4),("apache2",pid=38071,fd=4),("apache2",pid=38070,fd=4),("apache2",pid=38069,fd=4),("apache2",pid=38068,fd=4),("apache2",pid=38067,fd=4),("apache2",pid=38066,fd=4))
LISTEN        0              4096                            [::]:10000                         [::]:*            users:(("miniserv.pl",pid=1447,fd=6))                                                                           
ubuntu@141:~$ 
ubuntu@141:~$ systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-10-29 20:25:11 +11; 35min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 38062 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 38066 (apache2)
      Tasks: 8 (limit: 28694)
     Memory: 18.1M
        CPU: 394ms
     CGroup: /system.slice/apache2.service
             ├─38066 /usr/sbin/apache2 -k start
             ├─38067 /usr/sbin/apache2 -k start
             ├─38068 /usr/sbin/apache2 -k start
             ├─38069 /usr/sbin/apache2 -k start
             ├─38070 /usr/sbin/apache2 -k start
             ├─38071 /usr/sbin/apache2 -k start
             ├─38073 /usr/sbin/apache2 -k start
             └─38147 /usr/sbin/apache2 -k start

oct. 29 20:25:11 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: Starting The Apache HTTP Server...
oct. 29 20:25:11 141.145.209.128cpanel.maxitag.netcpanel systemd[1]: Started The Apache HTTP Server.
ubuntu@141:~$ 

Hors ligne

#34 Le 29/10/2022, à 12:19

matrix-bx

Re : [Résolu] Apache2 (l'appli) ne démarre plus

waca a écrit :

Le résultat de sudo ss -tnlp a été obtenu après l'arrêt d'apache (comme l'a demandé matrix-bx)

Arrêter apache c'est juste le temps de tester avec "openssl s_server" en utilisant "openssl s_client" et/ou "gnutls-cli".

Dernière modification par matrix-bx (Le 29/10/2022, à 12:20)


Utilisations des balises de mises en formes.

Hors ligne

#35 Le 29/10/2022, à 12:36

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

ubuntu@141:~$ sudo systemctl stop apache2
ubuntu@141:~$ KEY=/etc/letsencrypt/live/cloud.maxitag.net/privkey.pem
ubuntu@141:~$ CERT=/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem
ubuntu@141:~$ sudo openssl s_server -key $KEY -cert $CERT -accept 443 -www
Using default temp DH parameters
ACCEPT

J'ai une fenetre qui s'affiche:
Impossible de se connecter d emanière sécurisée à cloud.maxitag.net
le certificat de l'emetteur d'un certificat localement est introuvable
aucun certificat n'a pu être vérifié

avec certificat cloud.maxitag.net
Orgnisation <non spécifié>
Unité <non spécifié>
Pays <non spécifié>
puis
Empreinte  sha-256  avec ses infos
Enpreinte  sha-512  avec ses infos

Date début validité  28/10
date expiration 26 janv

Emetteur:  R3
Organisation Let's Encrypt
Unité: 
Pays  US

ubuntu@141:~$ openssl s_client -connect cloud.maxitag.net:443
2040F08AFFFF0000:error:8000006F:system library:BIO_connect:Connection refused:../crypto/bio/bio_sock2.c:125:calling connect()
2040F08AFFFF0000:error:10000067:BIO routines:BIO_connect:connect error:../crypto/bio/bio_sock2.c:127:
connect:errno=111
ubuntu@141:~$ gnutls-cli --ca-auto-retrieve cloud.maxitag.net
Processed 127 CA certificate(s).
Resolving 'cloud.maxitag.net:443'...
Connecting to '141.145.209.128:443'...
Could not connect to 141.145.209.128:443: Connection refused

Hors ligne

#36 Le 29/10/2022, à 12:40

bruno

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Peut-tu nous donner le retour complet de :

sudo openssl x509 -in /etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem -text -noout

Est-ce que tu peux nous montre la commande utilisée pour générer tes certificats ?

Dernière modification par bruno (Le 29/10/2022, à 12:43)


Attention, les bouteilles vendues par Nestlé Waters sont contaminées au monoxyde de dihydrogène.

Hors ligne

#37 Le 29/10/2022, à 12:51

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

ubuntu@141:~$ sudo openssl x509 -in /etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem -text -noout
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            03:3b:8b:96:f7:93:27:f1:ab:60:df:f0:31:5c:ad:6e:be:03
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C = US, O = Let's Encrypt, CN = R3
        Validity
            Not Before: Oct 28 14:17:18 2022 GMT
            Not After : Jan 26 14:17:17 2023 GMT
        Subject: CN = cloud.maxitag.net
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    00:aa:06:2f:fe:46:da:61:58:b4:13:a5:fc:05:2c:
                    c0:0f:07:74:f9:06:72:9a:0a:61:4b:c6:71:00:b3:
                    0b:49:de:de:f7:e9:5d:8c:37:f1:47:95:7f:ec:10:
                    87:de:02:af:b2:47:eb:b7:08:fb:f2:d8:b4:be:b4:
                    83:55:51:0e:12:9c:74:3b:d3:b5:b7:9f:4f:d4:d1:
                    d6:b3:fd:84:79:e4:a6:f4:3d:74:2c:1a:87:cd:b3:
                    af:54:eb:09:48:5d:04:08:6e:7e:b3:f2:f6:6a:aa:
                    27:51:0f:45:34:11:00:6c:12:72:f2:f0:07:e7:0d:
                    5a:79:8c:ef:e6:98:b5:57:0a:91:2e:86:89:47:a8:
                    c2:54:02:2b:a5:32:a9:a5:2c:c9:68:bf:c2:75:af:
                    ee:03:a2:58:0a:3f:f9:81:e1:5f:28:5d:c8:92:e6:
                    06:7b:33:1d:81:ad:b6:f8:57:8f:dc:07:6e:6f:4a:
                    16:6e:ca:48:b5:2b:40:14:f4:2a:09:d4:25:ea:2c:
                    58:01:41:1b:50:41:46:69:d3:e3:a3:c7:6a:9a:00:
                    f9:3b:cd:b9:84:47:c1:ed:87:7e:f7:50:d9:af:f4:
                    7e:13:55:88:c3:11:3f:c6:1c:d5:f2:5d:8e:2c:0d:
                    5c:01:9b:e4:d2:53:27:81:10:4e:cb:38:2a:12:6e:
                    1a:43
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Key Usage: critical
                Digital Signature, Key Encipherment
            X509v3 Extended Key Usage: 
                TLS Web Server Authentication, TLS Web Client Authentication
            X509v3 Basic Constraints: critical
                CA:FALSE
            X509v3 Subject Key Identifier: 
                B6:B2:EA:EB:B5:74:DD:7C:A1:3F:5D:B6:03:EB:22:98:92:43:EB:7C
            X509v3 Authority Key Identifier: 
                14:2E:B3:17:B7:58:56:CB:AE:50:09:40:E6:1F:AF:9D:8B:14:C2:C6
            Authority Information Access: 
                OCSP - URI:http://r3.o.lencr.org
                CA Issuers - URI:http://r3.i.lencr.org/
            X509v3 Subject Alternative Name: 
                DNS:cloud.maxitag.net
            X509v3 Certificate Policies: 
                Policy: 2.23.140.1.2.1
                Policy: 1.3.6.1.4.1.44947.1.1.1
                  CPS: http://cps.letsencrypt.org
            CT Precertificate SCTs: 
                Signed Certificate Timestamp:
                    Version   : v1 (0x0)
                    Log ID    : B7:3E:FB:24:DF:9C:4D:BA:75:F2:39:C5:BA:58:F4:6C:
                                5D:FC:42:CF:7A:9F:35:C4:9E:1D:09:81:25:ED:B4:99
                    Timestamp : Oct 28 15:17:18.724 2022 GMT
                    Extensions: none
                    Signature : ecdsa-with-SHA256
                                30:46:02:21:00:EF:7E:34:8B:1A:5A:46:15:99:D0:70:
                                42:C6:97:89:23:3A:0A:9F:8C:90:8E:C7:95:CB:BF:2F:
                                18:91:4B:3E:DE:02:21:00:FF:53:42:99:B5:EA:85:73:
                                91:FA:7F:82:58:5F:7A:5F:57:28:7F:37:42:6A:2B:88:
                                C5:AC:E8:DD:DB:0E:91:01
                Signed Certificate Timestamp:
                    Version   : v1 (0x0)
                    Log ID    : E8:3E:D0:DA:3E:F5:06:35:32:E7:57:28:BC:89:6B:C9:
                                03:D3:CB:D1:11:6B:EC:EB:69:E1:77:7D:6D:06:BD:6E
                    Timestamp : Oct 28 15:17:18.722 2022 GMT
                    Extensions: none
                    Signature : ecdsa-with-SHA256
                                30:44:02:20:2C:61:36:AC:85:56:27:7E:B3:02:92:2E:
                                90:F0:DA:CC:63:20:10:DD:4F:13:54:CC:68:BB:09:E1:
                                9E:02:C0:82:02:20:48:2A:B3:DA:AA:26:E5:B6:5E:27:
                                6D:D8:5C:44:FA:EF:C4:76:62:4F:43:56:F9:DF:C3:4C:
                                C0:54:2D:30:B2:62
    Signature Algorithm: sha256WithRSAEncryption
    Signature Value:
        78:80:d4:71:41:28:08:d0:f1:56:4d:65:00:53:de:b7:3d:fe:
        c1:bd:7a:19:2b:c4:81:9c:f9:47:9a:ce:32:02:19:d7:37:36:
        2d:5e:f4:f3:a0:cf:a3:8f:3d:a5:62:e9:62:ce:8b:4d:26:e3:
        39:f0:54:9b:7f:74:43:16:c2:1c:3b:7a:e6:58:b2:cb:99:6e:
        b6:9d:45:ed:d2:f9:4f:1d:41:cc:bc:35:df:69:3f:08:1e:c6:
        7b:01:a9:f9:c0:a6:24:ba:16:f4:5c:81:a1:17:7b:20:8e:62:
        8c:87:8c:9f:7e:a1:ab:c7:94:18:bd:19:c1:62:8b:d1:be:b2:
        b5:f6:96:37:6b:86:cc:2c:7f:d0:30:64:31:00:ea:97:4e:b5:
        b0:9b:12:12:8e:86:78:44:f3:ab:86:3f:5f:20:d1:bf:45:40:
        a7:c6:d9:62:5a:8b:a6:00:27:f8:35:5d:36:6d:8f:dc:9d:3d:
        6a:09:5c:47:28:6b:14:9c:82:b3:9b:5b:8f:4c:92:75:49:d2:
        24:c0:26:c6:6e:0c:dd:6a:9a:24:ce:ac:80:cc:f9:73:dd:b1:
        9c:3c:09:c9:0e:97:0a:c0:29:8d:24:d6:02:41:39:d9:02:6e:
        da:ed:5b:5d:ae:0a:fe:53:af:7f:7b:12:9a:08:14:d6:82:78:
        de:cc:0d:01
ubuntu@141:~$ 
ubuntu@141:~$ sudo certbot certonly --webroot -w /var/www/nextcloud -d cloud.maxitag.net -d cloud.maxitag.net

Hors ligne

#38 Le 29/10/2022, à 13:28

bruno

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Bon c'est correct, il y a juste un -d cloud.maxitag.net en double dans la commande certbot mais cela ne devrait pas provoquer d'erreurs.

Reste à voir ce fichier :
/etc/letsencrypt/options-ssl-apache.conf


Attention, les bouteilles vendues par Nestlé Waters sont contaminées au monoxyde de dihydrogène.

Hors ligne

#39 Le 29/10/2022, à 13:46

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.

SSLEngine off

# Intermediate configuration, tweak to your needs
SSLProtocol +TLSv1.2 +TLSv1.3
SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE>
SSLHonorCipherOrder     off
SSLSessionTickets       off

SSLOptions +StrictRequire

# Add vhost name to log entries:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common

Hors ligne

#40 Le 29/10/2022, à 14:14

bruno

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Ah ! Évidemment cela ne peut pas fonctionner :

SSLEngine off

À commenter ou mettre à on
Et la ligne ici est coupée :

SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE>

à vérifier si c'est dans le fichier ou si c'est juste un problème de copier /coller non maîtrisé depuis un terminal.


Attention, les bouteilles vendues par Nestlé Waters sont contaminées au monoxyde de dihydrogène.

Hors ligne

#41 Le 29/10/2022, à 14:30

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Oups, en effet, désolé pour cette inattention...

SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384

Hors ligne

#42 Le 29/10/2022, à 14:34

waca

Re : [Résolu] Apache2 (l'appli) ne démarre plus

Ca y est!!!!   Le site 'tourne'.....
IMMENSE merci, pour votre patience....

Hors ligne

#43 Le 29/10/2022, à 16:11

bruno

Re : [Résolu] Apache2 (l'appli) ne démarre plus

De rien. wink
Je t'invite à modifier ton premier message pour ajouter [Résolu] devant le titre.


Attention, les bouteilles vendues par Nestlé Waters sont contaminées au monoxyde de dihydrogène.

Hors ligne