nginx 使用安装问题及解决方案
如何安装清参考:http://www.runoob.com/linux/nginx-install-setup.html
可以先不用配置,等理解后在配置。
在启动nginx时,出现提示:
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]: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 [::]: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 [::]: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 [::]: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 [::]:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
原因是因为80 端口已被其他的程式占用,所以需要kill掉其他的进程。
使用命令: fuser -n tcp 80 查看;
然后使用 kill -9 [进程名] ...
然后出新输nginx 启动命令。
在浏览器上使用localhost 打开,会出现提示:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at
nginx.com.
Thank you for using nginx.
那么恭喜你启动成功哦哦。
注意还没有进行配置,这只是默认的配置。