nginx bind falhou

0

quando eu executo o nginx, recebo um erro,

O nginx é iniciado a partir dos scripts de execução do npm

Eu tinha executado npm run start-prod scripts: start-prod: tem o seguinte comando

 concurrently --no-color "uwsgi --ini build/docker/uwsgi.ini" "nginx"  "npm run render-prod"

npm run valor render-prod para script é "render-prod": "nó babel nó / react-render.jsx"

[email protected] start-prod /home/ubuntu/bharath/sourcecode/projects/NTDL/ntdl
> concurrently --no-color "uwsgi --ini build/docker/uwsgi.ini" "nginx"  "npm run render-prod"    
[0] [uWSGI] getting INI configuration from build/docker/uwsgi.ini    
[0] *** Starting uWSGI 2.0.15 (64bit) on [Wed Feb 14 01:10:08 2018] ***    
[0] compiled with version: 5.4.0 20160609 on 09 February 2018 02:01:25    
[0] os: Linux-4.4.0-1049-aws #58-Ubuntu SMP Fri Jan 12 23:17:09 UTC 2018    
[0] nodename: ip-10-254-3-58
[0] machine: x86_64        
[0] clock source: unix            
[0] pcre jit disabled    
[0] detected number of CPU cores: 8    
[0] current working directory: 
/home/ubuntu/bharath/sourcecode/projects/NTDL/ntdl    
[0] writing pidfile to 
/home/ubuntu/bharath/sourcecode/projects/NTDL/ntdl/build/docker/ntdl.pid    
[0] detected binary path: /usr/local/bin/uwsgi    
[0] setgid() to 33    
[0] setuid() to 33    
[0] chdir() to /home/ubuntu/bharath/sourcecode/projects/NTDL/ntdl    
[0] your processes number limit is 60090    
[0] your memory page size is 4096 bytes    
[0] detected max file descriptor number: 1048576    
[0] lock engine: pthread robust mutexes    
[0] thunder lock: disabled (you can enable it with --thunder-lock)    
[0] bind(): Permission denied [core/socket.c line 230]    
[1] nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored    
[1] nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)    
[0] uwsgi --ini build/docker/uwsgi.ini exited with code 1
[2]    
[2] > [email protected] render-prod /home/ubuntu/bharath/sourcecode/projects/NTDL/ntdl    
[2] > babel-node node/react-render.jsx    
[2]    
[1] nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)    
[1] nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)    
[1] nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
[2] React render server listening at http://0.0.0.0:9009
[1] nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
[1] nginx: [emerg] still could not bind()
[1] nginx exited with code 1

Por favor, ajude-me a corrigir este erro de ligação do nginx.

TIA,

Atenciosamente, Bharath AK

    
por A K Bharath 14.02.2018 / 01:27

1 resposta

0

Algum outro processo já está escutando na porta 80. Isso pode significar, por exemplo, que você já tem um processo Apache em execução.

Você pode usar este comando sugerido para descobrir o que pode estar escutando nessa porta:

sudo lsof -i :80 | grep LISTEN

Nota: Em casos raros, pode ser que um nginx separado já esteja escutando na porta, por exemplo, se você iniciou manualmente um daemon nginx (não recomendado) ou se você modificou em qual usuário o nginx está sendo executado (não recomendado) . Mais do que provavelmente, no entanto, será algum outro aplicativo escutando nessa porta.

O Ubuntu permite que você instale dois servidores web de uma só vez, já que é possível configurá-los para ouvir em portas diferentes. Se você não fizer isso, você terá problemas com um ou outro começo.

    
por thomasrutter 14.02.2018 / 02:24