Ads 468x60px

##EasyReadMore##

02 11月, 2016

nginx 服務啟動不了

nginx 服務啟動不了
[FAILED] Failed to start nginx Web Server.

由下可知在讀取 ssl-cert-snakeoil.pem 時出現錯誤

systemctl status nginx -l
Nov 02 16:31:27 WR-IDP-PRO4208 nginx[1803]: nginx: [emerg] PEM_read_bio_X509_AUX("/etc/nginx/ssl/ssl-cert-snakeoil.pem") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)

可以看到 key 的 size 全部變零了

ls /etc/nginx/ssl/ -al
total 8
drwxr-xr-x 2 root root     4096 Jun  4  2029 .
drwxr-xr-x 5 root root     4096 Jun  4  2029 ..
-rw-r----- 1 root www-data    0 Jun  4  2029 ssl-cert-snakeoil.key
-rw-r--r-- 1 root root        0 Jun  4  2029 ssl-cert-snakeoil.pem

所以只要從另外一台機台複製這兩個檔即可

chmod 640 /etc/nginx/ssl/ssl-cert-snakeoil.key
chmod 644 /etc/nginx/ssl/ssl-cert-snakeoil.pem

-rw-r----- 1 root root     1704 May 27 12:14 ssl-cert-snakeoil.key
-rw-r----- 1 root www-data    0 Jun  4  2029 ssl-cert-snakeoil.keyb
-rw-r--r-- 1 root root     1021 May 27 12:14 ssl-cert-snakeoil.pem
-rw-r--r-- 1 root root        0 Jun  4  2029 ssl-cert-snakeoil.pemb

再把服務開起來就好

systemctl start nginx.service

0 意見:

張貼留言

 
Blogger Templates