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.

#1 Le 27/09/2022, à 11:53

waca

[RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Bonjour la commmunauté,
J'ai pris un VPS chez "oracle"   
J'install nextcloud, mais pour la génération du certificat j'ai l'erreur suivante: voir la dernière ligne:
J'ai fait aussi un
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow http
sudo ufw allow https

Voici ma commande (dans ci-dessous, j'ai modifié le nom dns et le mail)

ubuntu@w10:~$ sudo certbot -v certonly --webroot -w /var/www/nextcloud --agree-tos --no-eff-email --email cloud@icimoi.net -d cloud.icimoi.net --rsa-key-size 4096
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Requesting a certificate for cloud.icimoi.net
Performing the following challenges:
http-01 challenge for cloud.icimoi.net
Using the webroot path /var/www/nextcloud for all unmatched domains.
Waiting for verification...
Challenge failed for domain cloud.icimoi.net
http-01 challenge for cloud.icimoi.net

Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
  Domain: cloud.icimoi.net
  Type:   connection
  Detail: 149.145.219.128: Fetching http://cloud.icimoi.net/.well-known/acme-challenge/f4m5913sOBMlms7oeQQcF1PXTq41rT0yDNBa8Hp3CUI: Timeout during connect (likely firewall problem)

Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.

Cleaning up challenges
Some challenges have failed.

Merci d'avance pour votre aide.
Waca

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

Hors ligne

#2 Le 27/09/2022, à 13:51

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Bonjour,

Cela ressemble effectivement à un problème de pare-feu. Il faut ressayer en désactivant ufw. Si cela ne suffit pas il faudra donner :

sudo iptables -L -n

Tu peux aussi vérifier depuis l'extérieur avec nmap :

nmap ip_du-serveur

Hors ligne

#3 Le 27/09/2022, à 23:27

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Bonjour et merci de ton aide.
Donc, j'ai fait
sudo ufw disable    la génération du cert est tjrs KO
donc, j'ai suivi ton    iptables      cert tjrs KO
voici le nmap:

corail@corail-asus:~$ nmap 149.145.219.128 -Pn
Starting Nmap 7.80 ( https://nmap.org ) at 2022-09-28 07:49 +11
Nmap scan report for 149.145.219.128
Host is up (0.31s latency).
Not shown: 998 filtered ports
PORT     STATE SERVICE
22/tcp   open  ssh
3389/tcp open  ms-wbt-server

Alors, je réactive ufw (pour tester/forcer le port 80 et 443)

ubuntu@w10:~$ sudo ufw status verbose
État : actif
Journalisation : on (low)
Par défaut : deny (incoming), allow (outgoing), disabled (routed)
Nouveaux profils : skip

Vers                       Action      De
----                       ------      --
80/tcp                     ALLOW IN    Anywhere                  
443                        ALLOW IN    Anywhere                  
80                         ALLOW IN    Anywhere                  
22                         ALLOW IN    Anywhere                  
443/tcp                    ALLOW IN    Anywhere                  
80/tcp (v6)                ALLOW IN    Anywhere (v6)             
443 (v6)                   ALLOW IN    Anywhere (v6)             
80 (v6)                    ALLOW IN    Anywhere (v6)             
22 (v6)                    ALLOW IN    Anywhere (v6)             
443/tcp (v6)               ALLOW IN    Anywhere (v6) 

Toujours KO
J'ai même tenté un
sudo ufw default allow incoming

Et voilà ma toute dernière commande:

sudo ufw allow in on eth0 to any port 80
sudo ufw allow in on eth0 to any port 443

mais bon....la génération du certificat affiche toujours exactement la même chose !
Merci

Dernière modification par waca (Le 27/09/2022, à 23:34)

Hors ligne

#4 Le 28/09/2022, à 07:51

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Le retour de nmap montre clairement qu'il n'y a que deux services accessibles :
- SSH sur le port 22 ;
- un service inconnu (RDP ?) sur le port 3389.
Donc soit les ports 80 et 443 sont filtrés soit le serveur web n'est pas fonctionnel.

J'ai demandé le retour de la commande :

sudo iptables -L -n

pour voir ce qui est réellement filtré par le serveur.

Donne aussi  :

sudo ss -tnlp

pour voir les services en écoute sur le serveur.


EDIT :

J'ai pris un VPS chez "oracle"

Il va falloir aussi préciser à quel service tu as souscrit.
Apparemment chez Oracle tout le trafic à destination des VPS est bloqué et il faut aller sur leur interface pour créer des règles Ingress : https://cleavr.io/cleavr-slice/how-to-d … cloud-vps/

Dernière modification par bruno (Le 28/09/2022, à 08:32)

Hors ligne

#5 Le 28/09/2022, à 08:45

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Oups désolé, je ne savais pas que tu souhaitais le retour...
Le port 3389 c'est l'accès  RDP
Le serveur web est  nginx
voici ce que tu demandais.

ubuntu@w10:~$ sudo iptables -L -n
Chain INPUT (policy DROP)
target     prot opt source               destination         
ufw-before-logging-input  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-before-input  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-after-input  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-after-logging-input  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-reject-input  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-track-input  all  --  0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy DROP)
target     prot opt source               destination         
ufw-before-logging-forward  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-before-forward  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-after-forward  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-after-logging-forward  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-reject-forward  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-track-forward  all  --  0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ufw-before-logging-output  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-before-output  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-after-output  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-after-logging-output  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-reject-output  all  --  0.0.0.0/0            0.0.0.0/0           
ufw-track-output  all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-after-forward (1 references)
target     prot opt source               destination         

Chain ufw-after-input (1 references)
target     prot opt source               destination         
ufw-skip-to-policy-input  udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:137
ufw-skip-to-policy-input  udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:138
ufw-skip-to-policy-input  tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:139
ufw-skip-to-policy-input  tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:445
ufw-skip-to-policy-input  udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:67
ufw-skip-to-policy-input  udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:68
ufw-skip-to-policy-input  all  --  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type BROADCAST

Chain ufw-after-logging-forward (1 references)
target     prot opt source               destination         
LOG        all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-after-logging-input (1 references)
target     prot opt source               destination         
LOG        all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-after-logging-output (1 references)
target     prot opt source               destination         

Chain ufw-after-output (1 references)
target     prot opt source               destination         

Chain ufw-before-forward (1 references)
target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 3
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 11
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 12
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 8
ufw-user-forward  all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-before-input (1 references)
target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
ufw-logging-deny  all  --  0.0.0.0/0            0.0.0.0/0            ctstate INVALID
DROP       all  --  0.0.0.0/0            0.0.0.0/0            ctstate INVALID
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 3
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 11
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 12
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 8
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:67 dpt:68
ufw-not-local  all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     udp  --  0.0.0.0/0            224.0.0.251          udp dpt:5353
ACCEPT     udp  --  0.0.0.0/0            239.255.255.250      udp dpt:1900
ufw-user-input  all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-before-logging-forward (1 references)
target     prot opt source               destination         

Chain ufw-before-logging-input (1 references)
target     prot opt source               destination         

Chain ufw-before-logging-output (1 references)
target     prot opt source               destination         

Chain ufw-before-output (1 references)
target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
ufw-user-output  all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-logging-allow (0 references)
target     prot opt source               destination         
LOG        all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW ALLOW] "

Chain ufw-logging-deny (2 references)
target     prot opt source               destination         
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            ctstate INVALID limit: avg 3/min burst 10
LOG        all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-not-local (1 references)
target     prot opt source               destination         
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type MULTICAST
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type BROADCAST
ufw-logging-deny  all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10
DROP       all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-reject-forward (1 references)
target     prot opt source               destination         

Chain ufw-reject-input (1 references)
target     prot opt source               destination         

Chain ufw-reject-output (1 references)
target     prot opt source               destination         

Chain ufw-skip-to-policy-forward (0 references)
target     prot opt source               destination         
DROP       all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-skip-to-policy-input (7 references)
target     prot opt source               destination         
DROP       all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-skip-to-policy-output (0 references)
target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-track-forward (1 references)
target     prot opt source               destination         

Chain ufw-track-input (1 references)
target     prot opt source               destination         

Chain ufw-track-output (1 references)
target     prot opt source               destination         
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            ctstate NEW
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            ctstate NEW

Chain ufw-user-forward (1 references)
target     prot opt source               destination         

Chain ufw-user-input (1 references)
target     prot opt source               destination         
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:443
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:443
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:22
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:22
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:443
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:3389
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:80
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:443
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:443

Chain ufw-user-limit (0 references)
target     prot opt source               destination         
LOG        all  --  0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 5 LOG flags 0 level 4 prefix "[UFW LIMIT BLOCK] "
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable

Chain ufw-user-limit-accept (0 references)
target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           

Chain ufw-user-logging-forward (0 references)
target     prot opt source               destination         

Chain ufw-user-logging-input (0 references)
target     prot opt source               destination         

Chain ufw-user-logging-output (0 references)
target     prot opt source               destination         

Chain ufw-user-output (1 references)
target     prot opt source               destination

Et voici pour la command   ss tnlp

ubuntu@w10:~$ sudo ss -tnlp
State   Recv-Q  Send-Q     Local Address:Port     Peer Address:Port  Process                                                    
LISTEN  0       80             127.0.0.1:3306          0.0.0.0:*      users:(("mariadbd",pid=1215,fd=20))                       
LISTEN  0       4096             0.0.0.0:111           0.0.0.0:*      users:(("rpcbind",pid=819,fd=4),("systemd",pid=1,fd=36))  
LISTEN  0       4096       127.0.0.53%lo:53            0.0.0.0:*      users:(("systemd-resolve",pid=951,fd=14))                 
LISTEN  0       128              0.0.0.0:22            0.0.0.0:*      users:(("sshd",pid=1173,fd=3))                            
LISTEN  0       128            127.0.0.1:631           0.0.0.0:*      users:(("cupsd",pid=4500,fd=7))                           
LISTEN  0       4096                [::]:111              [::]:*      users:(("rpcbind",pid=819,fd=6),("systemd",pid=1,fd=38))  
LISTEN  0       128                    *:21                  *:*      users:(("proftpd",pid=1266,fd=0))                         
LISTEN  0       128                 [::]:22               [::]:*      users:(("sshd",pid=1173,fd=4))                            
LISTEN  0       2                  [::1]:3350             [::]:*      users:(("xrdp-sesman",pid=1098,fd=7))                     
LISTEN  0       128                [::1]:631              [::]:*      users:(("cupsd",pid=4500,fd=6))                           
LISTEN  0       2                      *:3389                *:*      users:(("xrdp",pid=1157,fd=11)) 

Hors ligne

#6 Le 28/09/2022, à 09:10

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Je ne vois aucun service en écoute sur les ports 80 et 443
Retour de :

systemctl status nginx

et ce que j'ai ajouté en fin du #4 reste valable.

Hors ligne

#7 Le 28/09/2022, à 10:05

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Désolé de le mettre en majuscule mais...je suis trop content

J'AI TROUVé   smile  smile  smile

En fait, j'ai
1°) Sur oracle ouvert les ports 80 et 443  puis,
2°) tenté une méthode d'install par  snap  (pour automatiser une maximum)
et à la génération de la clé, dans l'erreur j'ai obtenu l'info 'magique'....

To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

Pfffftttt, quelle OUBLI, et quel temps perdu.....  désolé, et merci encore pour ton aide....
J'ai rajouté le   A    et l'interface admin de nextcloud est opérationnelle.

Bonne fin de semaine.

Hors ligne

#8 Le 01/10/2022, à 07:30

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Salut à tous,
Le 'détail' de la conf est dans le sujet

Vu les besoins de ma famille, on a décidé de passer sur un cloud autohébergé.
J'ai donc vu chez oracle cloud tier, la possibilité gratuite d'une VM de
4coeur/24Go de ram/200Go de disque.
J'ai 'monté' la machine et TOUT fonctionne (même nextcloud), trop fier je suis.

MAIS, je voudrai 'sécuriser' un peu la bête.....

Mon soucis, c'est que je n'arrive à rien (j'y comprend rien) pour le certificat.
Quitte à repartir à 0 sur cette partie (certificat), l'associer à la machine? ou
à l'appli Nginx ou à Nextcloud ?
Le but final étant que le certificat soit au minimum sur Netxcloud, si on peut parler
comme ça.

J'ai un accès 'graphique' à U22.04(Gnome), et bien sûr l'accès ssh

Merci d'avance pour votre aide.
Waca

Hors ligne

#9 Le 01/10/2022, à 13:38

Vobul

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Qu'est-ce que tu ne comprends pas ? La documentation est très complète et claire : https://letsencrypt.org/docs/ et surtout https://certbot.eff.org/instructions?ws … buntufocal


Vobul
Utilisez le retour utilisable de commandes !!!
J'aime la langue française, mais je parle franglais, deal with it.
RTFM

En ligne

#10 Le 02/10/2022, à 08:34

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Modération :
C'est le même problème qu'ici qui était censé être résolu…

Je fusionne les  deux fils. (#1 à #7 avec #8 et #9)

Dernière modification par bruno (Le 02/10/2022, à 08:36)

Hors ligne

#11 Le 03/10/2022, à 08:41

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Merci Bruno d'avoir fusionné, je faisais une différence entre le fait d'obtenir l'interface Nextcloud web(:80) et
le passage en 'sécurisé'... D'où mon 2ème post spécifique à la sécurité.
Et bien sûr, j'appréhende de planter mon accès (qui fonctionne super bien pour le moment) mais sans sécurité.
Bon, du coup, je suis(merci Vobul) les procédures certbot et déjà j'ai une erreur,   /etc/letsencrypt/live et en effet
ce dossier  /live n'existe pas... est-ce que je devrais désinstaller complètement  letsencrypt?

$ sudo certbot --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem": 
BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem, r) error:10000080:BIO routines::no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

The nginx plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError('Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx: [emerg] cannot load certificate "/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem, r) error:10000080:BIO routines::no such file)\nnginx: configuration file /etc/nginx/nginx.conf test failed\n')

Hors ligne

#12 Le 04/10/2022, à 15:17

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Ta commande certbot échoue car il y a une erreur de configuration nginx :

nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem": 

qui doit provenir d'une tentative précédente.
Il faut regarder ce que tu as modifié et supprimer ce qui fait référence au fichier inexistant /etc/letsencrypt/live/cloud.maxitag.net/fullchain.pem

Hors ligne

#13 Le 06/10/2022, à 03:56

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

C'est là qu'est l'os hélas smile    Je  ne trouve pas dans mon nginx.conf de telle ref.

user www-data;
worker_processes 4;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        types_hash_max_size 2048;
        server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}

Hors ligne

#14 Le 06/10/2022, à 05:28

Vobul

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;


Vobul
Utilisez le retour utilisable de commandes !!!
J'aime la langue française, mais je parle franglais, deal with it.
RTFM

En ligne

#15 Le 06/10/2022, à 08:50

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Merci, j'ai l'impression que ça avant  'un peu'...
il y a encore une erreur ci-après, ne sachant pas s'il faut mettre
le domaine  cloud.maxitag.net   ou   uniquement   maxitag.net
j'ai testé avec les 2...

ubuntu@w10:~$ sudo certbot --nginx
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): cloud.maxitag.net
Requesting a certificate for cloud.maxitag.net

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
  Domain: cloud.maxitag.net
  Type:   unauthorized
  Detail: 141.145.209.128: Invalid response from http://cloud.maxitag.net/.well-known/acme-challenge/2nXN_aWLEGUG3VqGuRpVFu4lKFjFy85_eMGvpHK7dyU: 403

Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.

Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

Hors ligne

#16 Le 06/10/2022, à 11:09

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Vérifions les enregistrement DNS :

$ dig +short cloud.maxitag.net
141.145.209.128

⇒ OK
La réponse du serveur web :

$ curl -I http://cloud.maxitag.net/
HTTP/1.1 302 Found
…

⇒ OK

Au vu du message d'erreur (403 = accès refusé) il y a donc dans ta configuration nginx ou dans les permissions des fichiers quelque chose qui interdit l'accès à h ttp://cloud.maxitag.net/.well-known/acme-challenge…

Hors ligne

#17 Le 07/10/2022, à 10:04

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Hé beh, c'est pas gagné, je viens de passer 2 heures sur différents sites, à modifer les
droits chown, chmod, a reprendre les fichiers de conf nginx...
Est-ce qu'il est possible de repartir à 0 uniquement sur la partie 'sécurité', afin que
je n'ai pas à casser ce qui fonctionne déjà en mode non sécurisé ?

Hors ligne

#18 Le 07/10/2022, à 11:04

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Montre-nous ton fichier de configuration nginx pour ton nextcloud et les droits d'accès sur le dossier racine de site (celui qui contient les fichiers nextcloud).

Hors ligne

#19 Le 07/10/2022, à 11:34

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Merci pour ta patience...
voici le nginx.conf

user www-data;
worker_processes 4;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        types_hash_max_size 2048;
        server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

#        include /etc/nginx/conf.d/*.conf;
#        include /etc/nginx/sites-enabled/*;
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}
ubuntu@w10:~$ namei -mo /var/www/nextcloud
f: /var/www/nextcloud
 drwxr-xr-x root      root     /
 drwxr-xr-x root      root     var
 drwxr-xr-x root      root     www
 drwxr-xr-x nextcloud www-data nextcloud

Hors ligne

#20 Le 07/10/2022, à 12:22

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

En principe on ne touche pas au fichier nginx.conf, la configuration se fait site par site dans /etc/nginx/sites-available (avec liens symboliques dans /etc/nginx/sites-enabled). Or les lignes qui incluent ces fichiers sont commentées, donc s'il n'y a que cela comme configuration je ne vois pas comment cela peu fonctionner…

EDIT :
Par ailleurs quand j'interroge ton site avec curl :

$ curl -I http://cloud.maxitag.net/
HTTP/1.1 302 Found
Date: Fri, 07 Oct 2022 10:23:21 GMT
Server: Apache

C'est Apache qui répond et non nginx…
Si tu as installé Nextcloud avec un snap (pouah… hmm)  c'est sans doute normal vu que le snap embarque tout : apache, mysql, etc

Et dans ce cas il faut voir leur doc (voir mon lien précédent) pour les problèmes de HTTPS.

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

Hors ligne

#21 Le 08/10/2022, à 05:24

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Bon alors, je me penche sur apache
Puisqu'il est installé, je tente ce qui dit:
https://doc.ubuntu-fr.org/tutoriel/secu … 2_avec_ssl

ubuntu@w10:~$ sudo a2enmod ssl                
sudo: a2enmod: command not found
ubuntu@w10:~$ sudo apt-get install a2enmod
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances... Fait
Lecture des informations d'état... Fait      
E: Impossible de trouver le paquet a2enmod

Je me dis, je vais réinstaller apache comme ceci mais j'appréhende que ça 'casse' ce qui fonctionne déjà.

Il semble que j'ai des difficultés pour 'avancer' sur apache aussi alors sad

Dernière modification par waca (Le 08/10/2022, à 05:25)

Hors ligne

#22 Le 08/10/2022, à 07:34

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Non surtout pas !
On ne s'est pas compris. Tu as installé Nextcloud sous forme de snap.
C'est un conteneur qui contient déjà :

https://github.com/nextcloud-snap/nextcloud-snap a écrit :

    Nextcloud 24
    Apache 2.4
    PHP 8.0
    MySQL 8
    Redis 6
    mDNS for network discovery

et donc c'est censé fonctionner tel quel sans avoir à installer ni configurer ni serveur web, ni MySQL.

Désolé mais je ne peux pas t'aider plus sur ce type d'installation

Hors ligne

#23 Le 08/10/2022, à 12:31

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Merci encore d'avoir essayé en tout cas.
Je vais faire une sauvegarde des fichiers synchronisés dans mon cloud.
Désinstaller les applis dans le snap
désinstaller snap
désinstaller nginx
et reparti 'propre' en essayer de ne pas passer par snap.

Hors ligne

#24 Le 09/10/2022, à 08:21

bruno

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Tu as la doc nextcloud-serveur qui normalement est correcte.

Dernière modification par bruno (Le 09/10/2022, à 13:57)

Hors ligne

#25 Le 09/10/2022, à 11:18

waca

Re : [RESOLU] Install Nextcloud sur vps U22.04 certificat et apcu

Merci encore, ton lien est 'cassé' smile lol à cause du httpS smile  smile ça me
rappelle klke chose.
j'ai trouvé celui-ci
https://doc.ubuntu-fr.org/nextcloud-serveur
Je m'y colle dans la semaine, bonne semaine aux travailleurs.

Hors ligne