凤问题描述:
[root@itheima local]# cd nginx/sbin/ [root@itheima 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)
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接: https://blog.csdn.net/zyhlearnjava/article/details/71908529cd /usr/local/nginx/sbin/
./nginx
这两条命令启动的。 在Ubuntu中是通过/etc/nginx.....,你会发现你的centOS7里面,etc下面根本就没有nginx这个folder! 在centOS7中你会发现这行不通,我们应该这么启动: [root@localhost ~]# /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) nginx: [emerg] still could not bind() 说明80端口被占用,杀掉这个进程: [root@localhost ~]# killall -9 nginx 再次启动nginx: [root@localhost ~]# /usr/local/nginx/sbin/nginx 查看是否启动: [root@localhost ~]# ps aux|grep nginx 输出: root 7110 0.0 0.0 24348 752 ? Ss 22:32 0:00 nginx: master process /usr/local/nginx/sbin/nginx nobody 7111 0.0 0.0 26860 1508 ? S 22:32 0:00 nginx: worker process root 7114 0.0 0.0 112664 968 pts/0 S+ 22:33 0:00 grep --color=auto nginx 启动成功!