HTTPS : Configuration services (stunnel4 + micro-httpd) Le sujet est résolu

Demande d'aide : c'est ici.
Répondre
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Bonjour, :006:


Je peaufine la configuration de base de mon petit serveur HTTPS (stunnel4 + micro-httpd)

Voici ce qui me pose question dans les "status" des services :

Code : Tout sélectionner

stunnel4.service
....
s_connect: connect ::1:80: Connection refused (111)

Code : Tout sélectionner

stunnel@micro-httpd.service - TLS tunnel for network daemons - per-config-file service
     Loaded: loaded (/lib/systemd/system/stunnel@.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code)......
     ...
     [!] Binding service [micro-httpd] failed

Sorties complètes :

Code : Tout sélectionner

# systemctl status stunnel*

● stunnel4.service - LSB: Start or stop stunnel 4.x (TLS tunnel for network daemons)
     Loaded: loaded (/etc/init.d/stunnel4; generated)
     Active: active (running) since Sat 2022-10-22 22:47:16 UTC; 14h ago
       Docs: man:systemd-sysv-generator(8)
    Process: 104221 ExecStart=/etc/init.d/stunnel4 start (code=exited, status=0/SUCCESS)
    Process: 104278 ExecReload=/etc/init.d/stunnel4 reload (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 2279)
     Memory: 2.0M
        CPU: 794ms
     CGroup: /system.slice/stunnel4.service
             └─104236 /usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf

Oct 23 12:53:47 server1.dezix.fr stunnel[104236]: LOG3[185]: SSL_accept: ../ssl/statem/statem_srvr.c:1779: error:142090C1:SSL routines:tls_early_post_process_client_hello:no shared cipher
Oct 23 12:53:47 server1.dezix.fr stunnel[104236]: LOG5[185]: Connection reset: 0 byte(s) sent to TLS, 0 byte(s) sent to socket
Oct 23 12:53:47 server1.dezix.fr stunnel[104236]: LOG5[186]: Service [micro-httpd] accepted connection from 87.236.176.169:48523
Oct 23 12:53:47 server1.dezix.fr stunnel[104236]: LOG3[186]: SSL_accept: ../ssl/statem/extensions_srvr.c:697: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share
Oct 23 12:53:47 server1.dezix.fr stunnel[104236]: LOG5[186]: Connection reset: 0 byte(s) sent to TLS, 0 byte(s) sent to socket
Oct 23 12:56:38 server1.dezix.fr stunnel[104236]: LOG5[187]: Service [micro-httpd] accepted connection from 45.11.57.48:50844
Oct 23 12:56:38 server1.dezix.fr stunnel[104236]: LOG3[187]: s_connect: connect ::1:80: Connection refused (111)
Oct 23 12:56:38 server1.dezix.fr stunnel[104236]: LOG5[187]: s_connect: connected 127.0.0.1:80
Oct 23 12:56:38 server1.dezix.fr stunnel[104236]: LOG5[187]: Service [micro-httpd] connected remote server from 127.0.0.1:38810
Oct 23 12:56:38 server1.dezix.fr stunnel[104236]: LOG5[187]: Connection closed: 583 byte(s) sent to TLS, 290 byte(s) sent to socket

● stunnel.target - TLS tunnels for network services - per-config-file target
     Loaded: loaded (/lib/systemd/system/stunnel.target; enabled; vendor preset: enabled)
     Active: active since Sun 2022-10-09 09:48:05 UTC; 2 weeks 0 days ago

Oct 09 09:48:05 server1.dezix.fr systemd[1]: Reached target TLS tunnels for network services - per-config-file target.

● stunnel@micro-httpd.service - TLS tunnel for network daemons - per-config-file service
     Loaded: loaded (/lib/systemd/system/stunnel@.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-10-22 22:53:44 UTC; 14h ago
       Docs: man:stunnel4(8)
    Process: 104317 ExecStart=/usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf (code=exited, status=1/FAILURE)
   Main PID: 104317 (code=exited, status=1/FAILURE)
        CPU: 16ms

Oct 22 22:53:44 server1.dezix.fr stunnel4[104317]: [ ] Setting accept socket options (FD=9)
Oct 22 22:53:44 server1.dezix.fr stunnel4[104317]: [ ] Option SO_REUSEADDR set on accept socket
Oct 22 22:53:44 server1.dezix.fr stunnel4[104317]: [.] Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 22 22:53:44 server1.dezix.fr stunnel4[104317]: [!] Binding service [micro-httpd] failed
Oct 22 22:53:44 server1.dezix.fr stunnel4[104317]: [ ] Deallocating section defaults
Oct 22 22:53:44 server1.dezix.fr stunnel4[104317]: [ ] Unbinding service [micro-httpd]
Oct 22 22:53:44 server1.dezix.fr stunnel4[104317]: [ ] Service [micro-httpd] closed
Oct 22 22:53:44 server1.dezix.fr stunnel4[104317]: [ ] Deallocating section [micro-httpd]
Oct 22 22:53:44 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Main process exited, code=exited, status=1/FAILURE
Oct 22 22:53:44 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Failed with result 'exit-code'.


Code : Tout sélectionner


# Extrait de journalctl -xe

Oct 23 12:52:59 server1.dezix.fr stunnel[104236]: LOG5[175]: Service [micro-httpd] accepted connection from 86.236.203.237:54820
Oct 23 12:52:59 server1.dezix.fr stunnel[104236]: LOG3[175]: s_connect: connect ::1:80: Connection refused (111)
Oct 23 12:52:59 server1.dezix.fr stunnel[104236]: LOG5[175]: s_connect: connected 127.0.0.1:80
Oct 23 12:52:59 server1.dezix.fr stunnel[104236]: LOG5[175]: Service [micro-httpd] connected remote server from 127.0.0.1:57440
Oct 23 12:52:59 server1.dezix.fr systemd[1]: Started micro-httpd (127.0.0.1:57440).
░░ Subject: A start job for unit micro-httpd@10494-127.0.0.1:80-127.0.0.1:57440.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit micro-httpd@10494-127.0.0.1:80-127.0.0.1:57440.service has finished successfully.
░░ 
░░ The job identifier is 1875322.
Oct 23 12:53:04 server1.dezix.fr systemd[1]: micro-httpd@10494-127.0.0.1:80-127.0.0.1:57440.service: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit micro-httpd@10494-127.0.0.1:80-127.0.0.1:57440.service has successfully entered the 'dead' state.
Oct 23 12:53:04 server1.dezix.fr stunnel[104236]: LOG5[175]: Connection closed: 557 byte(s) sent to TLS, 0 byte(s) sent to socket





Dans la configuration TLS du service : /etc/stunnel/micro-httpd.conf

j'ai remplacé la cible de la redirection du port 443 : connect = 80
par ces 2 paramètres:


connect = dezix.fr:80
connect = www.dezix.fr:80


suivi par :

Code : Tout sélectionner

# systemctl reload stunnel4
# systemctl restart stunnel@micro-httpd

cela a supprimé : s_connect: connect ::1:80: Connection refused (111)


Mais le status de stunnel@micro-httpd.service continue à afficher :

Active: failed (Result: exit-code) since ....

Code : Tout sélectionner

# systemctl status stunnel*
● stunnel4.service - LSB: Start or stop stunnel 4.x (TLS tunnel for network daemons)
     Loaded: loaded (/etc/init.d/stunnel4; generated)
     Active: active (running) since Sat 2022-10-22 22:47:16 UTC; 14h ago
       Docs: man:systemd-sysv-generator(8)
    Process: 104221 ExecStart=/etc/init.d/stunnel4 start (code=exited, status=0/SUCCESS)
    Process: 106847 ExecReload=/etc/init.d/stunnel4 reload (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 2279)
     Memory: 2.1M
        CPU: 880ms
     CGroup: /system.slice/stunnel4.service
             └─104236 /usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf

Oct 23 13:22:11 server1.dezix.fr stunnel[104236]: LOG5[main]: Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 23 13:22:11 server1.dezix.fr stunnel[104236]: LOG5[main]: Reading configuration from file /etc/stunnel/micro-httpd.conf
Oct 23 13:22:11 server1.dezix.fr stunnel[104236]: LOG5[main]: UTF-8 byte order mark detected
Oct 23 13:22:11 server1.dezix.fr stunnel[104236]: LOG5[main]: FIPS mode disabled
Oct 23 13:22:11 server1.dezix.fr stunnel[104236]: LOG5[main]: Configuration successful
Oct 23 13:22:11 server1.dezix.fr stunnel[104236]: LOG5[main]: Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 23 13:22:29 server1.dezix.fr stunnel[104236]: LOG5[194]: Service [micro-httpd] accepted connection from 86.236.203.237:43348
Oct 23 13:22:29 server1.dezix.fr stunnel[104236]: LOG5[194]: s_connect: connected 51.178.81.74:80
Oct 23 13:22:29 server1.dezix.fr stunnel[104236]: LOG5[194]: Service [micro-httpd] connected remote server from 51.178.81.74:57020
Oct 23 13:22:29 server1.dezix.fr stunnel[104236]: LOG5[194]: Connection closed: 4976 byte(s) sent to TLS, 223 byte(s) sent to socket

● stunnel.target - TLS tunnels for network services - per-config-file target
     Loaded: loaded (/lib/systemd/system/stunnel.target; enabled; vendor preset: enabled)
     Active: active since Sun 2022-10-09 09:48:05 UTC; 2 weeks 0 days ago

Oct 09 09:48:05 server1.dezix.fr systemd[1]: Reached target TLS tunnels for network services - per-config-file target.

● stunnel@micro-httpd.service - TLS tunnel for network daemons - per-config-file service
     Loaded: loaded (/lib/systemd/system/stunnel@.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2022-10-23 13:22:21 UTC; 3min 28s ago
       Docs: man:stunnel4(8)
    Process: 106884 ExecStart=/usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf (code=exited, status=1/FAILURE)
   Main PID: 106884 (code=exited, status=1/FAILURE)
        CPU: 16ms

Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Setting accept socket options (FD=9)
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Option SO_REUSEADDR set on accept socket
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [.] Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [!] Binding service [micro-httpd] failed
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Deallocating section defaults
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Unbinding service [micro-httpd]
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Service [micro-httpd] closed
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Deallocating section [micro-httpd]
Oct 23 13:22:21 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Main process exited, code=exited, status=1/FAILURE
Oct 23 13:22:21 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Failed with result 'exit-code'.


Je ne sais pas si l'état : Active: failed (Result: exit-code) de stunnel@micro-httpd.service
est normal dans la mesure où le serveur est inactif en attente de la prochaine requête,
ou si quelque-chose est mal ficelé malgré le bon fonctionnement (apparent) du site ?


Merci pour vos avis :banana_parachute:

-
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Comme personne ne propose rien, je suppose que j'ai mal présenté le problème,
alors je re formule la question dans un contexte plus générique.

Le manuel dit :

Code : Tout sélectionner

$ man systemctl

COMMANDS

The following commands are understood:
Unit Commands (Introspection and Modification)

	....

	status
	
		....
		
		Active
			....
			A special "failed" state is entered when the service failed in some way, such as a crash,
			exiting with an error code or timing out.
			
			If the failed state is entered the cause will be logged for later reference.

Sauf que ça ne me dit pas grand-chose :

Code : Tout sélectionner

● stunnel@micro-httpd.service - TLS tunnel for network daemons - per-config-file service
     Loaded: loaded (/lib/systemd/system/stunnel@.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2022-10-22 22:53:44 UTC; 14h ago
       Docs: man:stunnel4(8)
    Process: 104317 ExecStart=/usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf (code=exited, status=1/FAILURE)
   Main PID: 104317 (code=exited, status=1/FAILURE)
        CPU: 16ms

Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Setting accept socket options (FD=9)
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Option SO_REUSEADDR set on accept socket
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [.] Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [!] Binding service [micro-httpd] failed
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Deallocating section defaults
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Unbinding service [micro-httpd]
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Service [micro-httpd] closed
Oct 23 13:22:21 server1.dezix.fr stunnel4[106884]: [ ] Deallocating section [micro-httpd]
Oct 23 13:22:21 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Main process exited, code=exited, status=1/FAILURE
Oct 23 13:22:21 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Failed with result 'exit-code'.




Donc ce serait lié à un problème de : bind entre stunnel4.service et micro-httpd.socket


La seule occurrence de "bind" dans syslog

Code : Tout sélectionner

# grep bind /var/log/syslog
Oct 23 13:09:13 server1 stunnel4[106747]: [ ] Unbinding service [micro-httpd]
Oct 23 13:22:21 server1 stunnel4[106884]: [ ] Unbinding service [micro-httpd]
Correspond au status ci-dessus (qui reste identique à ce jour D+3)


Côté serveur HTTPD :

Code : Tout sélectionner

# systemctl list-units -t socket micro*
  UNIT               LOAD   ACTIVE SUB       DESCRIPTION
  micro-httpd.socket loaded active listening micro-httpd

Code : Tout sélectionner

# systemctl status micro-httpd.socket
● micro-httpd.socket - micro-httpd
     Loaded: loaded (/lib/systemd/system/micro-httpd.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Mon 2022-08-29 05:47:16 UTC; 1 months 27 days ago
   Triggers: ● micro-httpd@10963-51.178.81.74:80-172.105.89.161:41855.service
             ● micro-httpd@9810-51.178.81.74:80-23.94.255.80:51682.service
       Docs: man:micro-httpd(8)
     Listen: 0.0.0.0:80 (Stream)
   Accepted: 11211; Connected: 25;
      Tasks: 0 (limit: 2279)
     Memory: 112.0K
        CPU: 3.849s
     CGroup: /system.slice/micro-httpd.socket

Aug 29 05:47:16 server1.dezix.fr systemd[1]: Listening on micro-httpd.

Code : Tout sélectionner

# systemctl list-units --all micro*
  UNIT                                                           LOAD   ACTIVE SUB       DESCRIPTION
  micro-httpd@1026-51.178.81.74:80-192.210.207.202:50144.service loaded active running   micro-httpd
  micro-httpd@10963-51.178.81.74:80-172.105.89.161:41855.service loaded active running   micro-httpd (172.105.89.161:41855)
  micro-httpd@1453-51.178.81.74:80-172.105.77.209:42911.service  loaded active running   micro-httpd
  micro-httpd@1918-51.178.81.74:80-90.151.171.106:24204.service  loaded active running   micro-httpd
  micro-httpd@2197-51.178.81.74:80-172.105.77.209:38253.service  loaded active running   micro-httpd
  micro-httpd@3007-51.178.81.74:80-172.105.77.209:47481.service  loaded active running   micro-httpd
  micro-httpd@3074-51.178.81.74:80-90.151.171.106:10826.service  loaded active running   micro-httpd
  micro-httpd@3077-51.178.81.74:80-90.151.171.106:44350.service  loaded active running   micro-httpd
  micro-httpd@3651-51.178.81.74:80-172.105.77.209:56857.service  loaded active running   micro-httpd
  micro-httpd@4146-51.178.81.74:80-90.151.171.106:8360.service   loaded active running   micro-httpd
  micro-httpd@4157-51.178.81.74:80-172.105.77.209:37879.service  loaded active running   micro-httpd
  micro-httpd@421-51.178.81.74:80-90.151.171.106:53964.service   loaded active running   micro-httpd
  micro-httpd@4783-51.178.81.74:80-172.105.77.209:43077.service  loaded active running   micro-httpd
  micro-httpd@4952-51.178.81.74:80-90.151.171.106:12606.service  loaded active running   micro-httpd
  micro-httpd@5154-51.178.81.74:80-90.151.171.106:6736.service   loaded active running   micro-httpd
  micro-httpd@5595-51.178.81.74:80-90.151.171.106:10748.service  loaded active running   micro-httpd
  micro-httpd@5597-51.178.81.74:80-90.151.171.106:34612.service  loaded active running   micro-httpd
  micro-httpd@5871-51.178.81.74:80-172.105.77.209:44135.service  loaded active running   micro-httpd
  micro-httpd@6221-51.178.81.74:80-90.151.171.106:50412.service  loaded active running   micro-httpd
  micro-httpd@6301-51.178.81.74:80-90.151.171.106:3094.service   loaded active running   micro-httpd
  micro-httpd@6480-51.178.81.74:80-90.151.171.106:17972.service  loaded active running   micro-httpd
  micro-httpd@6975-51.178.81.74:80-172.105.89.161:48531.service  loaded active running   micro-httpd
  micro-httpd@7057-51.178.81.74:80-172.105.77.209:53979.service  loaded active running   micro-httpd
  micro-httpd@7950-51.178.81.74:80-172.105.89.161:51009.service  loaded active running   micro-httpd
  micro-httpd@9810-51.178.81.74:80-23.94.255.80:51682.service    loaded active running   micro-httpd (23.94.255.80:51682)  
  micro-httpd.socket                                             loaded active listening micro-httpd

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
26 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

Je découvre ces histoires de sockets (si j'ai compris, leur rôle est d'écouter un port et d'en transmettre le flux de données vers le service associé).

Dans le cas de micro-httpd le socket doit écouter le port 80 (http)
et
stunnel doit écouter sur le port 443 (https) et rediriger le flux vers le port 80.

Il me paraissait logique que stunnel ait eu aussi un socket pour écouter 443,
il semblerait que non :

Code : Tout sélectionner

# systemctl list-units -t socket
  UNIT                            LOAD   ACTIVE SUB       DESCRIPTION
  dbus.socket                     loaded active running   D-Bus System Message Bus Socket
  dm-event.socket                 loaded active listening Device-mapper event daemon FIFOs
  lvm2-lvmpolld.socket            loaded active listening LVM2 poll daemon socket
  micro-httpd.socket              loaded active listening micro-httpd
  syslog.socket                   loaded active running   Syslog Socket
  systemd-fsckd.socket            loaded active listening fsck to fsckd communication Socket
  systemd-initctl.socket          loaded active listening initctl Compatibility Named Pipe
  systemd-journald-audit.socket   loaded active running   Journal Audit Socket
  systemd-journald-dev-log.socket loaded active running   Journal Socket (/dev/log)
  systemd-journald.socket         loaded active running   Journal Socket
  systemd-udevd-control.socket    loaded active running   udev Control Socket
  systemd-udevd-kernel.socket     loaded active running   udev Kernel Socket

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
12 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.


J'espère que ces nouvelles données pourront vous inspirer quelques conseils,
car c'est là beaucoup de nouveauté pour moi et je crains de ne pas avoir assez d'éléments pour cerner le concept des sockets et de leur association avec les services qui sont derrières.

Merci.
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
lol
Site Admin
Site Admin
Messages : 4959
Inscription : 04 avr. 2016, 12:11
Localisation : Madagascar
Status : Hors-ligne

Salut,

Deux idées:

Problème de port déjà "lié" à un processus.
C'est peut-être du à la façon dont tu redémarres le daemon (restart ?).
J'ai déjà rencontré ce soucis.
Essaye de tuer le process et de simplement le démarrer.
Status renvoie la même chose ?

Tu peux montrer tes confs de http-bind et Stunnel ?
Un netstat donne quoi comme process sur les ports 80/443 qui seraient déjà utilisés ?
Règles d'usage du forum. Signalez si vous avez posté votre question sur un autre forum. Explications ici
Debian Unstable. Mate/LXQT. Dieu, en créant l'homme, a quelque peu surestimé ses capacités.
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Salut et merci de te pencher sur mon cas,
sur ce coup là je n'assure vraiment pas :rolleyes:

Je commence par le plus simple.
lol a écrit : 26 oct. 2022, 18:32 Tu peux montrer tes confs de http-bind et Stunnel ?

Config de Stunnel

Code : Tout sélectionner

# egrep -v '^(;|$)'  /etc/stunnel/stunnel.conf
; BOM
fips = no
log = append
syslog = yes

Code : Tout sélectionner

# egrep -v '^(;|$)'  /etc/stunnel/micro-httpd.conf
; BOM
[https]
accept = 443
cert = /etc/letsencrypt/live/dezix.fr/fullchain.pem
connect = dezix.fr:80
connect = www.dezix.fr:80
key = /etc/letsencrypt/live/dezix.fr/privkey.pem
service = micro-httpd
sslVersion = TLSv1.3
sslVersionMin = TLSv1.2

http-bind : je ne vois pas à cela correspond :blush:
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

(Re)démarrage des démons/services


j'ai d'abord regardé ce que j'avais comme processus :

Code : Tout sélectionner


# pgrep stunnel
104236

# ps -p 104236 -o 'comm= ruser'
                RUSER
stunnel4        root



# pgrep micro-httpd
10262
19449
...
20 < processus
...
102002
111228


# ps -p 10262 -o 'comm= ruser'
                RUSER
micro-httpd     www

et j'ai tué :068: tous les micro-httpd avec : # pkill micro-httpd

J'arrête tout :

Code : Tout sélectionner

# systemctl stop micro-httpd.socket
# systemctl stop stunnel@micro-httpd.service
# systemctl stop stunnel4.service
Vérification des processus :

Code : Tout sélectionner

# pgrep micro-httpd
(vide)

# pgrep stunnel
(vide)
plus rien

Pourtant le status de stunnel@micro-httpd.service indique toujours le PID: 114142

Code : Tout sélectionner

# systemctl status stunnel*

● stunnel.target - TLS tunnels for network services - per-config-file target
     Loaded: loaded (/lib/systemd/system/stunnel.target; enabled; vendor preset: enabled)
     Active: active since Sun 2022-10-09 09:48:05 UTC; 2 weeks 3 days ago

Oct 09 09:48:05 server1.dezix.fr systemd[1]: Reached target TLS tunnels for network services - per-config-file target.


● stunnel@micro-httpd.service - TLS tunnel for network daemons - per-config-file service
     Loaded: loaded (/lib/systemd/system/stunnel@.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2022-10-26 18:02:41 UTC; 2h 2min ago
       Docs: man:stunnel4(8)
    Process: 114142 ExecStart=/usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf (code=exited, status=1/FAILURE)
   Main PID: 114142 (code=exited, status=1/FAILURE)
        CPU: 66ms

Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Setting accept socket options (FD=9)
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Option SO_REUSEADDR set on accept socket
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [.] Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [!] Binding service [micro-httpd] failed
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Deallocating section defaults
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Unbinding service [micro-httpd]
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Service [micro-httpd] closed
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Deallocating section [micro-httpd]
Oct 26 18:02:41 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 18:02:41 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Failed with result 'exit-code'.

et le tuer ne donne rien, pas plus que ps

Code : Tout sélectionner

# kill 114142
-bash: kill: (114142) - No such process

# ps -p 114142 -o 'comm= ruser'
                RUSER
(vide)

Là j'en conclus qu'il y a une merde dans ce status qui continue à afficher : Active: failed
alors qu'il devrait indiquer : inactive ou dead
puisque rien ne tourne.


À ce stade le site est down !




Pour info :

Code : Tout sélectionner

# cat /lib/systemd/system/stunnel.target

[Unit]
Description=TLS tunnels for network services - per-config-file target

[Install]
WantedBy=multi-user.target
Donc ce target n'est à l'origine d'aucun processus.




En partant de cet état d'arrêt complet :


Après : # systemctl start micro-httpd.socket
le site fonctionne en HTTP uniquement

la sortie de : systemctl status stunnel*
reste inchangée par rapport à la dernière fois

et

Code : Tout sélectionner

# systemctl status micro-httpd.socket
● micro-httpd.socket - micro-httpd
     Loaded: loaded (/lib/systemd/system/micro-httpd.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Wed 2022-10-26 20:33:01 UTC; 1min 47s ago
       Docs: man:micro-httpd(8)
     Listen: 0.0.0.0:80 (Stream)
   Accepted: 11355; Connected: 0;
      Tasks: 0 (limit: 2279)
     Memory: 4.0K
        CPU: 923us
     CGroup: /system.slice/micro-httpd.socket

Oct 26 20:33:01 server1.dezix.fr systemd[1]: Listening on micro-httpd.



Après : # systemctl start stunnel4.service
le site refonctionne en HTTPS
et
il me semble que stunnel4.service est OK! mais vérifies tout de même,
la suite de la sortie est identique.
La sortie complète de systemctl status stunnel* est mise à la suite...


Je me rends compte de :

Code : Tout sélectionner

● stunnel4.service ...
...
CGroup: /system.slice/stunnel4.service
        └─114784 /usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf

avec :

# ps -p 114784 -o 'comm= ruser'
                RUSER
stunnel4        root

Du coup c'est ce processus qui fait tourner le site en HTTPS
et
stunnel@micro-httpd.service n'aurait pas lieu d'être ???




Code : Tout sélectionner

# systemctl status stunnel*

● stunnel4.service - LSB: Start or stop stunnel 4.x (TLS tunnel for network daemons)
     Loaded: loaded (/etc/init.d/stunnel4; generated)
     Active: active (running) since Wed 2022-10-26 20:38:26 UTC; 23s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 114769 ExecStart=/etc/init.d/stunnel4 start (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 2279)
     Memory: 1.6M
        CPU: 63ms
     CGroup: /system.slice/stunnel4.service
             └─114784 /usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf

Oct 26 20:38:26 server1.dezix.fr stunnel[114782]: LOG5[ui]: UTF-8 byte order mark detected
Oct 26 20:38:26 server1.dezix.fr stunnel[114782]: LOG5[ui]: FIPS mode disabled
Oct 26 20:38:26 server1.dezix.fr stunnel[114782]: LOG5[ui]: Configuration successful
Oct 26 20:38:26 server1.dezix.fr stunnel[114782]: LOG5[ui]: Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 26 20:38:26 server1.dezix.fr stunnel4[114769]: Starting TLS tunnels: /etc/stunnel/micro-httpd.conf: started (no pid=pidfile specified>
Oct 26 20:38:26 server1.dezix.fr systemd[1]: Started LSB: Start or stop stunnel 4.x (TLS tunnel for network daemons).
Oct 26 20:38:36 server1.dezix.fr stunnel[114784]: LOG5[0]: Service [micro-httpd] accepted connection from 86.236.203.237:57108
Oct 26 20:38:36 server1.dezix.fr stunnel[114784]: LOG5[0]: s_connect: connected 51.178.81.74:80
Oct 26 20:38:36 server1.dezix.fr stunnel[114784]: LOG5[0]: Service [micro-httpd] connected remote server from 51.178.81.74:42456
Oct 26 20:38:36 server1.dezix.fr stunnel[114784]: LOG5[0]: Connection closed: 4976 byte(s) sent to TLS, 219 byte(s) sent to socket





● stunnel.target - TLS tunnels for network services - per-config-file target
     Loaded: loaded (/lib/systemd/system/stunnel.target; enabled; vendor preset: enabled)
     Active: active since Sun 2022-10-09 09:48:05 UTC; 2 weeks 3 days ago

Oct 09 09:48:05 server1.dezix.fr systemd[1]: Reached target TLS tunnels for network services - per-config-file target.

● stunnel@micro-httpd.service - TLS tunnel for network daemons - per-config-file service
     Loaded: loaded (/lib/systemd/system/stunnel@.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2022-10-26 18:02:41 UTC; 2h 36min ago
       Docs: man:stunnel4(8)
    Process: 114142 ExecStart=/usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf (code=exited, status=1/FAILURE)
   Main PID: 114142 (code=exited, status=1/FAILURE)
        CPU: 66ms

Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Setting accept socket options (FD=9)
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Option SO_REUSEADDR set on accept socket
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [.] Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [!] Binding service [micro-httpd] failed
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Deallocating section defaults
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Unbinding service [micro-httpd]
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Service [micro-httpd] closed
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Deallocating section [micro-httpd]
Oct 26 18:02:41 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Main process exited, code=exited, status=1/FAILURE
Oct 26 18:02:41 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Failed with result 'exit-code'.




Qu'en penses-tu ?


Comme c'est déjà long j'arrête là pour l'instant,
en plus je ne connais pas netstat et il faut que je consulte.... :rtfm:


¡Hasta luego amigo!
**Simple Utilisateur** -- Debian stable - XFCE
PascalHambourg
Contributeur
Contributeur
Messages : 876
Inscription : 05 août 2016, 20:25
Status : Hors-ligne

Je n'ai pas tout lu mais concernant ceci :
dezix a écrit : 23 oct. 2022, 16:10

Code : Tout sélectionner

s_connect: connect ::1:80: Connection refused (111)
C'est visiblement lié au fait que stunnel4 tente de se connecter à localhost d'abord en IPv6 (::1) alors que micro-httpd n'écoute qu'en IPv4.
On peut voir dans la suite des logs qu'après cet échec stunnel4 se connecte avec succès à localhost en IPv4 (127.0.0.1).
A priori il devrait suffire de mettre dans la configuration

Code : Tout sélectionner

connect = 127.0.0.1:80
pour que stunnel4 se connecte au serveur web local directement en IPv4.

Tu as fais le choix de mettre le nom de domaine dezix.fr qui semble pointer vers l'adresse IPv4 publique de la machine. Cela suppose que le serveur web est accessible publiquement en HTTP et pas seulement en HTTPS.
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Je ne maîtrise pas du tout IPv6, mais je me suis posé la question de mettre 2 paramètres connect

Code : Tout sélectionner

connect = 127.0.0.1:80
connect = ::1:80
afin déviter les refus en IPv6,
mais n'étant pas trop sûre de mon coup, j'ai opté pour les noms de domaine (au moins pour commencer)
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Pour les services :

En relisant mes notes de config, je retrouve trace de comment j'ai créer ce service en m'inspirant d'un exemple pour Telnet, n'ayant rien trouvé sur la toile pour micro-httpd

Code : Tout sélectionner

# systemctl enable stunnel@micro-httpd.service --now
Created symlink /etc/systemd/system/multi-user.target.wants/stunnel@micro-httpd.service → /lib/systemd/system/stunnel@.service.

J'ai tenté de le supprimer :

Code : Tout sélectionner

# systemctl stop stunnel@micro-httpd.service

# systemctl stop stunnel4.service

# systemctl stop stunnel.target

# systemctl stop micro-httpd.socket

# systemctl disable stunnel@micro-httpd.service
Removed /etc/systemd/system/multi-user.target.wants/stunnel@micro-httpd.service.


Malheureusement, sans que je ne sache pourquoi, le service est encore là, avec le même status affiché :

Code : Tout sélectionner

# systemctl status stunnel*
● stunnel@micro-httpd.service - TLS tunnel for network daemons - per-config-file service
     Loaded: loaded (/lib/systemd/system/stunnel@.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2022-10-26 18:02:41 UTC; 14h ago
       Docs: man:stunnel4(8)
   Main PID: 114142 (code=exited, status=1/FAILURE)
        CPU: 66ms

Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Setting accept socket options (FD=9)
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Option SO_REUSEADDR set on accept socket
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [.] Binding service [micro-httpd] to :::443: Address already in use >
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [!] Binding service [micro-httpd] failed
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Deallocating section defaults
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Unbinding service [micro-httpd]
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Service [micro-httpd] closed
Oct 26 18:02:41 server1.dezix.fr stunnel4[114142]: [ ] Deallocating section [micro-httpd]
Oct 26 18:02:41 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Main process exited, code=exited, status=1/FA>
Oct 26 18:02:41 server1.dezix.fr systemd[1]: stunnel@micro-httpd.service: Failed with result 'exit-code'.

Pourtant le lien a bien été supprimé :

Code : Tout sélectionner

# ls /etc/systemd/system/multi-user.target.wants/stunnel@micro-httpd.service
ls: cannot access '/etc/systemd/system/multi-user.target.wants/stunnel@micro-httpd.service': No such file or directory
**Simple Utilisateur** -- Debian stable - XFCE
PascalHambourg
Contributeur
Contributeur
Messages : 876
Inscription : 05 août 2016, 20:25
Status : Hors-ligne

dezix a écrit : 27 oct. 2022, 10:48 Je ne maîtrise pas du tout IPv6, mais je me suis posé la question de mettre 2 paramètres connect

Code : Tout sélectionner

connect = 127.0.0.1:80
connect = ::1:80
afin déviter les refus en IPv6,
Pour éviter les refus en IPv6, il faudrait plutôt ne pas spécifier de cible IPv6.
Avatar de l’utilisateur
lol
Site Admin
Site Admin
Messages : 4959
Inscription : 04 avr. 2016, 12:11
Localisation : Madagascar
Status : Hors-ligne

Salut,

Je viens de tester et j'ai la même erreur LOG5[ui]: Binding service [https] to :::443: Address already in use (98) de temps en temps.
Ça n'empêche pas le service de fonctionner.

J'ai fait:

Code : Tout sélectionner

apt install stunnel4 micro-httpd
Pour la conf de micro-httpd je n'ai rien fait (ça écoute pas défaut sur le port 80)

Code : Tout sélectionner

# netstat -laputen | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          11576      1/init
Pour stunnel4 j'ai ça:

Code : Tout sélectionner

[https]
accept  = 443
connect = 80
cert = /etc/stunnel/stunnel.pem
Si je démarre Stunnel4, j'ai ces ports en écoute:

Code : Tout sélectionner

# netstat -laputen | grep LISTEN
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      0          15499      1349/stunnel4
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          11576      1/init

Et je me connecte bien à micro-http via le port 443 en SSL (Certificat autosigné, d'ou le cadenas dans le navigateur, normal)
Du coup le message à la con du status du service me semble pas être pertinent...
Capture du 2022-10-27 12-36-40.png

Donc.... pas si grave ?
Vous ne pouvez pas consulter les pièces jointes insérées à ce message.
Règles d'usage du forum. Signalez si vous avez posté votre question sur un autre forum. Explications ici
Debian Unstable. Mate/LXQT. Dieu, en créant l'homme, a quelque peu surestimé ses capacités.
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

@PH
J'ai suivi ton conseil en ne paramétrant que IPv4, j'obtiens le résultat escompté.

Merci Pascal.


@lol
Voici ce que dit netstat avec connect = 127.0.0.1:80 :

Code : Tout sélectionner

# netstat -laputen | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          1252433    1/init              
udp6       0      0 fe80::f816:3eff:fe5:123 :::*                                0          12763      628/ntpd            


# netstat -laputen | grep 443
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      0          1252774    116891/stunnel4     


# netstat -laputen | grep LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          1252433    1/init              
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      0          14042      1183/master         
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      0          1252774    116891/stunnel4     
tcp        0      0 0.0.0.0:12345           0.0.0.0:*               LISTEN      0          12936      626/sshd: /usr/sbin 
tcp6       0      0 :::25                   :::*                    LISTEN      0          14043      1183/master         
tcp6       0      0 :::12345                :::*                    LISTEN      0          12947      626/sshd: /usr/sbin 


Le site fonctionne correctement, mais si je passe l'IP avec ou sans l'indication du port 443, le navigateur me passe en HTTP ou demande acceptation du certificat pour HTTPS.
C'est sans-doute parce que je n'ai pas renseigné l'IP lors de la demande du certif à Let's Encrypt.
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Pour le service "zombi" (stunnel@micro-httpd.service)
une idée ?

Un reboot pourrait-il remettre les pendules à l'heure ?
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

Solution

J'ai tenté : # systemctl daemon-reload
mais cela n'a rien donné.

Je suis donc passé par : # reboot

Et j'ai eu :

Code : Tout sélectionner

# systemctl status stunnel.target
● stunnel.target - TLS tunnels for network services - per-config-file target
     Loaded: loaded (/lib/systemd/system/stunnel.target; enabled; vendor preset: enabled)
     Active: active since Thu 2022-10-27 13:46:31 UTC; 3min 26s ago

Warning: journal has been rotated since unit was started, output may be incomplete.

# systemctl status stunnel4.service
● stunnel4.service - LSB: Start or stop stunnel 4.x (TLS tunnel for network daemons)
     Loaded: loaded (/etc/init.d/stunnel4; generated)
     Active: inactive (dead)
       Docs: man:systemd-sysv-generator(8)

# systemctl status micro-httpd.socket
● micro-httpd.socket - micro-httpd
     Loaded: loaded (/lib/systemd/system/micro-httpd.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Thu 2022-10-27 13:46:37 UTC; 4min 49s ago
       Docs: man:micro-httpd(8)
     Listen: 0.0.0.0:80 (Stream)
   Accepted: 0; Connected: 0;
      Tasks: 0 (limit: 2279)
     Memory: 4.0K
        CPU: 224us
     CGroup: /system.slice/micro-httpd.socket
Donc plus trace de stunnel@micro-http.sercice


Dans cet état HTTPS n'est pas servi.

J'ai tout stoppé :

Code : Tout sélectionner

# systemctl stop micro-httpd.socket
# systemctl stop stunnel4.service
# systemctl stop stunnel.target

J'ai recréé le lien stunnel@micro-http.sercice

Code : Tout sélectionner

# systemctl enable stunnel@micro-httpd.service
Created symlink /etc/systemd/system/multi-user.target.wants/stunnel@micro-httpd.service → /lib/systemd/system/stunnel@.service.
puis, redémarré les services :

Code : Tout sélectionner

# systemctl start micro-httpd.socket
# systemctl start stunnel.target
# systemctl start stunnel4.service
ce qui donne :

Code : Tout sélectionner

# systemctl status stunnel* --all
● stunnel@micro-httpd.service - TLS tunnel for network daemons - per-config-file service
     Loaded: loaded (/lib/systemd/system/stunnel@.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:stunnel4(8)

● stunnel.target - TLS tunnels for network services - per-config-file target
     Loaded: loaded (/lib/systemd/system/stunnel.target; enabled; vendor preset: enabled)
     Active: active since Thu 2022-10-27 14:20:55 UTC; 36s ago

Oct 27 14:20:55 server1.dezix.fr systemd[1]: Reached target TLS tunnels for network services - per-config-file target.

● stunnel4.service - LSB: Start or stop stunnel 4.x (TLS tunnel for network daemons)
     Loaded: loaded (/etc/init.d/stunnel4; generated)
     Active: active (running) since Thu 2022-10-27 14:21:18 UTC; 13s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1456 ExecStart=/etc/init.d/stunnel4 start (code=exited, status=0/SUCCESS)
      Tasks: 2 (limit: 2279)
     Memory: 1.9M
        CPU: 54ms
     CGroup: /system.slice/stunnel4.service
             └─1475 /usr/bin/stunnel4 /etc/stunnel/micro-httpd.conf

Oct 27 14:21:18 server1.dezix.fr stunnel[1473]: LOG5[ui]: Compiled with OpenSSL 1.1.1k  25 Mar 2021
Oct 27 14:21:18 server1.dezix.fr stunnel[1473]: LOG5[ui]: Running  with OpenSSL 1.1.1n  15 Mar 2022
Oct 27 14:21:18 server1.dezix.fr stunnel[1473]: LOG5[ui]: Threading:PTHREAD Sockets:POLL,IPv6,SYSTEMD TLS:ENGINE,FIPS,OCSP,PSK,SNI Auth:LIBWRAP
Oct 27 14:21:18 server1.dezix.fr stunnel[1473]: LOG5[ui]: Reading configuration from file /etc/stunnel/micro-httpd.conf
Oct 27 14:21:18 server1.dezix.fr stunnel[1473]: LOG5[ui]: UTF-8 byte order mark detected
Oct 27 14:21:18 server1.dezix.fr stunnel[1473]: LOG5[ui]: FIPS mode disabled
Oct 27 14:21:18 server1.dezix.fr stunnel[1473]: LOG5[ui]: Configuration successful
Oct 27 14:21:18 server1.dezix.fr stunnel[1473]: LOG5[ui]: Binding service [micro-httpd] to :::443: Address already in use (98)
Oct 27 14:21:18 server1.dezix.fr stunnel4[1456]: Starting TLS tunnels: /etc/stunnel/micro-httpd.conf: started (no pid=pidfile specified!) /etc/stunnel/stunnel.conf: started (no pid=pidfile specified!)
Oct 27 14:21:18 server1.dezix.fr systemd[1]: Started LSB: Start or stop stunnel 4.x (TLS tunnel for network daemons).


# systemctl status micro-httpd.socket
● micro-httpd.socket - micro-httpd
     Loaded: loaded (/lib/systemd/system/micro-httpd.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Thu 2022-10-27 14:20:12 UTC; 19min ago
       Docs: man:micro-httpd(8)
     Listen: 0.0.0.0:80 (Stream)
   Accepted: 9; Connected: 0;
      Tasks: 0 (limit: 2279)
     Memory: 4.0K
        CPU: 806us
     CGroup: /system.slice/micro-httpd.socket

Oct 27 14:20:12 server1.dezix.fr systemd[1]: Listening on micro-httpd.


Plus d'erreurs, et tout semble bien fonctionner. :yahoo:


Encore merci pour votre aide :drinks:
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
lol
Site Admin
Site Admin
Messages : 4959
Inscription : 04 avr. 2016, 12:11
Localisation : Madagascar
Status : Hors-ligne

dezix a écrit : 27 oct. 2022, 12:03Le site fonctionne correctement, mais si je passe l'IP avec ou sans l'indication du port 443, le navigateur me passe en HTTP ou demande acceptation du certificat pour HTTPS.
C'est sans-doute parce que je n'ai pas renseigné l'IP lors de la demande du certif à Let's Encrypt.

Hello,
Un certificat est valide pour un nom de domaine (et éventuellement les sous-domaines) mais pas pour une IP.
C'est donc normal d'avoir une erreur de certificat.


Content que ça fonctionne en tout cas.
Règles d'usage du forum. Signalez si vous avez posté votre question sur un autre forum. Explications ici
Debian Unstable. Mate/LXQT. Dieu, en créant l'homme, a quelque peu surestimé ses capacités.
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

lol a écrit : 27 oct. 2022, 17:33 Content que ça fonctionne en tout cas.
:023:

Je me sens comme un broussard qui taille sa route à coups de sabre d’abattis ... ça avance... lentement :115:
**Simple Utilisateur** -- Debian stable - XFCE
Avatar de l’utilisateur
lol
Site Admin
Site Admin
Messages : 4959
Inscription : 04 avr. 2016, 12:11
Localisation : Madagascar
Status : Hors-ligne

dezix a écrit : 27 oct. 2022, 18:57Je me sens comme un broussard qui taille sa route à coups de sabre d’abattis ... ça avance... lentement :115:

On est pas pressés... :wink:

Question: pourquoi avoir choisi Stunnel+micro-http ?
Pour beaucoup plus simple/performant et pas beaucoup plus lourd tu aurais pu opter pour un nginx ou lighttpd.
Règles d'usage du forum. Signalez si vous avez posté votre question sur un autre forum. Explications ici
Debian Unstable. Mate/LXQT. Dieu, en créant l'homme, a quelque peu surestimé ses capacités.
Avatar de l’utilisateur
dezix
Membre hyper actif
Membre hyper actif
Messages : 3546
Inscription : 04 juin 2016, 14:50
Status : Hors-ligne

J'ai recherché pour l'amour du KISS et pour apprendre une solution minimaliste pour servir un site statique.

La prochaine étape sera lighttpd et probablement nginx la suivante.

De toute façon sans tester réellement, on se rend pas vraiment compte et on reste sur des doutes et des suppositions ;
là je verrais bien à l'usage si ça tient la route ou si je dois me tourner vers autre chose.

Il est vrai qu'à moins d'être sur un système très limité au niveau du stockage, lighttpd sans module occupe 1.2Mo et stunnel + micro-httpd la moitié,
pour ce qui est des ressources utilisées je ne sais pas trop, il faudrait tester cela un jour sur des VM identiques.
**Simple Utilisateur** -- Debian stable - XFCE
Répondre