ok merci me servira à coup sur
[Discussion] Certificat SSL signé et gratuit avec Let's Encrypt
- Modifié
allan84 https://certbot.eff.org/all-instructions/#debian-8-jessie-nginx
Automating renewal
The Certbot packages on your system come with a cron job that will renew your certificates automatically before they expire. Since Let's Encrypt certificates last for 90 days, it's highly advisable to take advantage of this feature. You can test automatic renewal for your certificates by running this command:
certbot renew --dry-run
merci Aerya mais franchement j'y comprends rien. j'ignore absolument ou on doit mettre cette commande que tu donnes au-dessus. je préfère faire le renouvelement manuellement
Oki doki
Personnellement je trouve que c'est un peu galère de renouveler l'opération tous les 3 mois.
Je ne sais pas si on peux juste appuyer sur un bouton ou crontab le truc
Beh... C'est prévu pour tourner en CRON en effet. Après faut savoir un minimum utiliser Linux mais ça fait partie des bases ce genre de job.
- Modifié
Le mieux étant de mettre Cerbot dans /opt pas /tmp (le tuto indique /tmp, je vois pas trop pourquoi) sinon à chaque reboot ...
Il y a une commande qui permet de savoir combien de jours le certificat est encore valide ?
Excellent! Merci beaucoup!
Adieu...heu StartSSL.
Bonne année à tous! Longue vie à mondedie.
- Modifié
Bonsoir à tous,
Je me permets de faire appel à vous car, tout comme remonté par fabb24, je ne parviens pas à la relancer le service nginx après avoir modifié la conf.
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
# systemctl status nginx -l
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Mon 2017-01-16 23:01:29 CET; 5s ago
Docs: man:nginx(8)
Process: 29245 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 1297 (code=exited, status=0/SUCCESS)
Jan 16 23:01:29 yoz nginx[29245]: nginx: [emerg] BIO_new_file("/etc/nginx/ssl/dhparams.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/dhparams.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
Jan 16 23:01:29 yoz nginx[29245]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jan 16 23:01:29 yoz systemd[1]: nginx.service: control process exited, code=exited status=1
Jan 16 23:01:29 yoz systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jan 16 23:01:29 yoz systemd[1]: Unit nginx.service entered failed state.
Mes fichiers de conf sont édités de la manière suivante:
/etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll; # gestionnaire d'évènements epoll (kernel 2.6+)
}
http {
#Requete maximun par ip
limit_req_zone $binary_remote_addr zone=flood:10m rate=100r/s;
limit_req zone=flood burst=100 nodelay;
#Connexions maximum par ip
limit_conn_zone $binary_remote_addr zone=ddos:10m;
limit_conn ddos 100;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log combined;
error_log /var/log/nginx/error.log error;
sendfile on;
keepalive_timeout 15;
keepalive_disable msie6;
keepalive_requests 100;
tcp_nopush on;
tcp_nodelay off;
server_tokens off;
gzip on;
gzip_comp_level 5;
gzip_min_length 512;
gzip_buffers 4 8k;
gzip_proxied any;
gzip_vary on;
gzip_disable "msie6";
gzip_types
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
application/vnd.ms-fontobject
font/truetype
font/opentype
image/svg+xml;
include /etc/nginx/sites-enabled/*.conf;
include /etc/nginx/ssl/params.conf;
}
/etc/nginx/sites-enabled/rutorrent.conf
server {
listen 80 default_server;
listen 443 default_server ssl http2;
server_name mydomain.ovh;
charset utf-8;
index index.html index.php;
client_max_body_size 10M;
ssl_certificate /etc/letsencrypt/live/mydomain.ovh/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.ovh/privkey.pem;
include /etc/nginx/conf.d/ciphers.conf;
access_log /var/log/nginx/rutorrent-access.log combined;
error_log /var/log/nginx/rutorrent-error.log error;
error_page 500 502 503 504 /50x.html;
location = /50x.html { root /usr/share/nginx/html; }
auth_basic "seedbox";
auth_basic_user_file "/etc/nginx/passwd/rutorrent_passwd";
location = /favicon.ico {
access_log off;
log_not_found off;
}
## début config accueil serveur ##
location ^~ / {
root /var/www/base;
include /etc/nginx/conf.d/php.conf;
include /etc/nginx/conf.d/cache.conf;
satisfy any;
allow all;
}
## fin config accueil serveur ##
## debut config rutorrent ##
location ^~ /rutorrent {
root /var/www;
include /etc/nginx/conf.d/php.conf;
include /etc/nginx/conf.d/cache.conf;
}
location ~ /\.svn {
deny all;
}
location ~ /\.ht {
deny all;
}
location ^~ /rutorrent/conf/ {
deny all;
}
location ^~ /rutorrent/share/ {
deny all;
}
## fin config rutorrent ##
## config utilisateurs ##
location /YOZ {
include scgi_params;
scgi_pass 127.0.0.1:5001;
auth_basic "seedbox";
auth_basic_user_file "/etc/nginx/passwd/rutorrent_passwd_yoz";
}
location /cakebox/ {
rewrite ^/cakebox(/.*)$ $1 break;
proxy_pass http://127.0.0.1:81;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
}
location /cakebox/yoz/ {
alias /home/yoz/torrents/;
add_header Content-Disposition "attachment";
satisfy any;
allow all;
}
}
/etc/nginx/ssl/params.conf
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_ecdh_curve secp384r1;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA";
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/mydomain.ovh/fullchain.pem;
resolver 8.8.8.8;
Avez-vous une idée de ce qui a pu m'échapper ? Quels doivent être les droits associés au dossier /etc/letsencrypt ?
Merci d'avance
Salut,
/etc/nginx/ssl/dhparams.pem existe bien ?
Bonsoir,
Merci pour la réponse !
Le fichier est bien présent oui
/etc/nginx/ssl# ls -al
total 8
-rw------- 1 root root 424 Jan 16 19:08 dhparams.pem
-rw-r--r-- 1 root root 808 Jan 16 23:47 params.conf
C'est une histoire de droits ?
- Modifié
Salut
sur le coup j'ai cru un probléme de droit mais non car chez moi pareil
ls -al /etc/nginx/ssl/
-rw------- 1 root root 424 janv. 15 21:59 dhparams.pem
-rw-r--r-- 1 root root 1391 janv. 15 21:56 server.crt
-rw-r--r-- 1 root root 1704 janv. 15 21:56 server.key
sinon tu as modifier quoi comme conf?
test un truc, enlève include /etc/nginx/ssl/params.conf; de ngnix.conf
- Modifié
Bonsoir,
Si ça n'est pas une question de droit ça devient embêtant..
J'arrivais à avoir accès à ruttorent et à cakebox jusqu'à ce que je me lance dans l'ajout de certificat.
Le service nginx ne se lance pas avec la config que j'ai donné, mais j'arrive néanmoins à avoir accès à l'interface de cakebox lorsque les lignes suivantes sont commentées dans le fichier de conf rutorrent.conf :
# listen 443 default_server ssl http2;
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
Côté ruttorent, la redirection vers https est faite automatiquement par mon navigateur (firefox) et cela malgré les lignes commentées.. J'obtiens une belle page d'erreur en retour :/.
J'ai aussi tenté la réinstall de nginx en suivant les commandes données par ex sans grand succès.
Quels fichiers restent à vérifier du coup ?
Merci d'avance,
Bonjour,
Je suis surpris du chemin de ton certificat LetsEncrypt. Normalement, c'est de la forme :
/etc/letsencrypt/live/nomdedomain/cert.pem
- Modifié
Bonsoir à tous,
Merci Nekukab pour cette remarque ! J'avais volontairement tenté de déplacer les fichier sous /etc/nginx/ssl pour voir si l'erreur persistait et ai oublié de le remettre par la suite..
Après avoir remplacé /etc/nginx/ssl par /etc/letsencrypt/live/nomdedomain/, j'ai obtenu une erreur différente.
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: failed (Result: exit-code) since Wed 2017-01-18 20:01:03 CET; 56s ago
Docs: man:nginx(8)
Process: 1669 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 22509 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 1672 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 22512 (code=exited, status=0/SUCCESS)
Jan 18 20:01:03 yoz nginx[1672]: nginx: [emerg] SSL_CTX_load_verify_locations("/etc/nginx/ssl/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/nginx/ssl/fullchain.pem','r') erro...
Jan 18 20:01:03 yoz nginx[1672]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jan 18 20:01:03 yoz systemd[1]: nginx.service: control process exited, code=exited status=1
Jan 18 20:01:03 yoz systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Jan 18 20:01:03 yoz systemd[1]: Unit nginx.service entered failed state.
J'ai alors enlevé le include /etc/nginx/ssl/params.conf; de ngnix.conf et depuis ça fonctionne !!
Du coup, la configuration donnée dans le tuto est incorrecte ?
- Modifié
snivel
Salut
je t’avais dit de l’enlever.
"test un truc, enlève include /etc/nginx/ssl/params.conf; de ngnix.conf" car cher moi je l'avais pas pour une config standard .
en faite cette ligne et deja dans /etc/nginx/conf.d/ciphers.conf
et pour le tuto il est bon mais cest configurer différemment par rapport au tuto que tu as suivi pour ngnix