Debian

在 debian 8 上安裝 nginx-full 的問題

  • November 3, 2020

我在 debian jessie 上安裝 nginx pkg (nginx-full) 時遇到一些問題

# apt-get install nginx-full
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
 nginx-common
Suggested packages:
 fcgiwrap nginx-doc
The following NEW packages will be installed:
 nginx-common nginx-full
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 510 kB of archives.
After this operation, 1.271 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://debian.c3sl.ufpr.br/debian/ jessie/main nginx-common all 1.6.1-1 [83,6 kB]
Get:2 http://debian.c3sl.ufpr.br/debian/ jessie/main nginx-full amd64 1.6.1-1+b1 [427 kB]
Fetched 510 kB in 1s (266 kB/s)     
Selecting previously unselected package nginx-common.
(Reading database ... 170540 files and directories currently installed.)
Preparing to unpack .../nginx-common_1.6.1-1_all.deb ...
Unpacking nginx-common (1.6.1-1) ...
Selecting previously unselected package nginx-full.
Preparing to unpack .../nginx-full_1.6.1-1+b1_amd64.deb ...
Unpacking nginx-full (1.6.1-1+b1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up nginx-common (1.6.1-1) ...
Setting up nginx-full (1.6.1-1+b1) ...
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript nginx, action "start" failed.
dpkg: error processing package nginx-full (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
nginx-full
E: Sub-process /usr/bin/dpkg returned an error code (1)

# systemctl status nginx.service
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 Sex 2014-09-05 11:39:46 BRT; 1s ago
 Process: 2972 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

#journalctl -xn
No journal files were found.

有人知道如何解決嗎?

在Debian 錯誤 #754407上報告了一個類似的問題。最後它只是被其他程序(Apache2)佔用的埠80。這可能也是你的情況嗎?

停止 apache2

service apache2 stop

然後安裝 nginx

apt-get install nginx

那就慶祝吧!

引用自:https://unix.stackexchange.com/questions/153980