在 debian 8 上安装 nginx-full 的问题

gno*_*mex 29 debian nginx

我在 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.
Run Code Online (Sandbox Code Playgroud)

有人知道怎么修吗?

小智 30

Debian 错误 #754407上报告了类似的问题。最后只是端口 80 被其他进程(Apache2)占用。这可能也是你的情况吗?


小智 22

停止 apache2

service apache2 stop
Run Code Online (Sandbox Code Playgroud)

然后安装nginx

apt-get install nginx
Run Code Online (Sandbox Code Playgroud)

那就庆祝吧!


sha*_*ali 15

就我而言,我执行了

sudo apt-get remove nginx* --purge 之后我安装了nginx-common

sudo apt-get install nginx-common
Run Code Online (Sandbox Code Playgroud)

然后我安装了 nginx

sudo apt-get install nginx
Run Code Online (Sandbox Code Playgroud)

在此之后,我在浏览器中输入了 ip 并且它起作用了