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

运行web项目时,用nginx启动的需要做如下配置,

nginx.conf ,在电脑中存放的位置是:/usr/local/etc/nginx/nginx.conf

匹配路径修改:

mac nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)_第1张图片

配置完成以后,cd 项目路径进入VEM文件夹,执行nginx命令,如果正常则可访问浏览器localhost:8082,成功运行

若遇到如下问题:nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)

原因:

80端口已被占用(可能因为未成功关闭一些服务,如nginx服务等)

解决:

sudo nginx -s stop(这个自己验证效果比较好)(或者:sudo nginx -s quit),然后重新启动(sudo nginx).

当然,如果是因为其他服务占用了80端口,如Apache服务等,则把对应服务器关掉(sudo apachectl stop).

编译:cd到VEM文件夹执行grunt命令,views文件夹内容被覆盖

mac nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)_第2张图片

你可能感兴趣的:(mac nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use))