Um problema similar foi reportado no erro Debian # 754407 . No final, foi apenas a porta 80 sendo tomada por outro processo (Apache2). Esse pode ser seu caso também?
Eu tenho alguns problemas para instalar o nginx pkg (nginx-full) no debian jessie
# 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.
Alguém sabe como consertar isso?
Um problema similar foi reportado no erro Debian # 754407 . No final, foi apenas a porta 80 sendo tomada por outro processo (Apache2). Esse pode ser seu caso também?
Pare o apache2
service apache2 stop
em seguida, instale o nginx
apt-get install nginx
Então comemore!
no meu caso eu executo
sudo apt-get remove nginx* --purge
depois disso eu instalo o nginx-common
sudo apt-get install nginx-common
então eu instalo o nginx
sudo apt-get install nginx
depois disso eu digite ip no navegador e funcionou
no meu caso o erro é o servidor ter o IPv6 desabilitado. apenas edite os arquivos de configuração do nginx para corrigir (por exemplo: / etc / nginx / sites-enabled / default) e reinicie o nginx demon.
Eu tive o mesmo problema. Eu não tenho Apache, e nada mais estava bloqueando minha porta 80. Eu não pude instalar o nginx com
sudo apt-get install nginx
nem com
sudo apt-get install nginx-common nginx-full
Após uma semana, deparei com este pequeno blog: link
Neste blog, a solução é:
sudo apt-get install nginx-common
listen [::]:80 default_server;
de / etc / nginx / sites-enabled / default (fiz isso usando o usuário-raiz) sudo apt-get update
e, em seguida, sudo apt-get upgrade
. sudo apt-get install nginx-full
e deu certo! Depois eu pude ver a tela de títulos do nginx, quando eu digitei o IP do meu servidor remoto!
Eu estava tendo o mesmo problema. O conselho sobre o Apache não era relevante, pois eu o desinstalei ativamente durante a configuração.
Acontece que eu estava vendo o resultado de um conflito entre o arquivo de configuração do nginx /etc/nginx/nginx.conf
e o script de serviço em /lib/systemd/system/nginx.service
.
Especificamente, o script de serviço estava iniciando o nginx com algumas opções, incluindo daemon on
:
$ cat /lib/systemd/system/nginx.service
...
[Service]
...
ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
...
Corri /usr/sbin/nginx -g 'daemon on; master_process on;'
diretamente no terminal e recebi o seguinte erro:
nginx: [emerg] "daemon" directive is duplicate in /etc/nginx/nginx.conf:1
Eu dei uma olhada em /etc/nginx/nginx.conf
e encontrei (na linha 1):
daemon off;
Comentando isso e executando sudo apt-get -f install
resolveu o problema.
Encontrei esse problema quando apt-get remove nginx
e apt-get automove nginx
e depois do que eu removi manualmente a pasta nginx. Quando eu apt-get install nginx
novamente, esse problema sai.
~# apt-get install
nginx Reading package lists... Done Building dependency tree Reading state information... Done nginx is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 140 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Setting up nginx-full (1.6.2-5+deb8u4) ... 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 dpkg: dependency problems prevent configuration of nginx: nginx depends on nginx-full (>= 1.6.2-5+deb8u4) | nginx-light (>= 1.6.2-5+deb8u4) | nginx-extras (>= 1.6.2-5+deb8u4); however:
Package nginx-full is not configured yet. Package nginx-light is not installed. Package nginx-extras is not installed. nginx depends on nginx-full (<< 1.6.2-5+deb8u4.1~) | nginx-light (<< 1.6.2-5+deb8u4.1~) | nginx-extras (<< 1.6.2-5+deb8u4.1~); however: Package nginx-full is not configured yet. Package nginx-light is not installed.
Package nginx-extras is not installed.dpkg: error processing package nginx (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: nginx-full nginx E: Sub-process /usr/bin/dpkg returned an error code (1)
e
~# 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 Tue 2017-03-21 04:35:29 EDT; 1min 33s ago
Process: 19912 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE) Main PID: 18408 (code=exited, status=0/SUCCESS)Mar 21 04:35:29 dayinhu nginx[19912]: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory) Mar 21 04:35:29 dayinhu nginx[19912]: nginx: configuration file /etc/nginx/nginx.conf test failed Mar 21 04:35:29 dayinhu systemd[1]: nginx.service: control process exited, code=exited status=1 Mar 21 04:35:29 dayinhu systemd[1]: Failed to start A high performance web server and a reverse proxy server. Mar 21 04:35:29 dayinhu systemd[1]: Unit nginx.service entered failed state.
Dizem que o nginx.conf perdeu, eu tentei muitas vezes sem sucesso.
Finalmente eu corrigi,
apt-get purge nginx nginx-common nginx-full
apt-get install nginx
80
para 443