nginx 反向代理 总结

查看nginx 安装目录

[root@tang closer]# whereis nginx

nginx: /usr/local/nginx

启动nginx

[root@tang conf]# /usr/local/nginx/sbin/nginx

出现端口被占用问题

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

查看哪些进程占用80端口号

[root@tang conf]#  netstat -ltunp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name

tcp        0      0 0.0.0.0:80              0.0.0.0:*              LISTEN      32706/nginx: master

杀掉该进程

[root@tang conf]# kill -9 32706

启动nginx

[root@tang conf]# /usr/local/nginx/sbin/nginx

猜你喜欢

转载自blog.csdn.net/qq_43361434/article/details/106187461