nginx报错:
nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
原因:nginx启动端口默认是80端口,出现这个错误,多半是80端口已经被占用。
解决:在nginx的安装目录下的bin目录下找到 nginx.conf 文件,在文件中修改 listen 对应的端口号,此处改为了81。
server {
listen 81;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
本文介绍了解决Nginx启动时遇到的端口冲突问题,通常是因为80端口被其他服务占用。通过修改Nginx配置文件中的监听端口,可以有效避免此问题。


被折叠的 条评论
为什么被折叠?



