[运维] 如何解决 nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
环境:
虚拟机 linux centos 7 64
当时正在配置 nginx , 由于解压后的 nginx 默认安装位置是在 /usr/local/ 目录下, 而这个目录是 root 用户才有权限操作的目录, 作为开发人员的 dev 用户是无法操作这里面的内容的, 但是又不能把所有的东西都交给 root 用户去操作, 所用当我尝试着用 dev 用户去启动 nginx 服务器的时候, 系统报错

由于 nginx 的默认端口为 80, 所以我需要修改一下默认端口,
首先, 修改 /usr/local/nginx 目录的操作权限, 让 dev 用户也可以操作这个文件夹
我们先来查看 dev 用户所对应的组,,,
id [user name]

然后修改 dev 用户对这个文件夹的权限
chown -R gz_dev:gz_dev /usr/local/nginx
前一个 gz_dev 是用户名, 后一个 gz_dev 是用户所在的组, 后面的目录就是要开放给用户操作的目录, 成功后用 gz_dev 用户进入 /nginx/conf 目录下, 修改 nginx.conf 配置文件中的端口

把原来的注释掉, 然后新配置一个端口号

OK , 现在dev 用户也可以操作 nginx 服务器了~
[运维] 如何解决 nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)的更多相关文章
- 解决Mac nginx问题 [emerg] 54933#0: bind() to 0.0.0.0:80 failed (13: Permission denied)
brew services restart nginx Stopping nginx... (might take a while) ==> Successfully stopped nginx ...
- Ubuntu nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
在Ubuntu 12中启动刚安装好的Nginx,报错: nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) 原因如下: ...
- php fpm安装curl后,nginx出现connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied)的错误
这里选择直接apt-get安装,因为比起自己编译简单多了,不需要自己配置什么 #sudo apt-get install curl libcurl3 libcurl3-dev php5-curl 安装 ...
- nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
启动nginx时报这个错 , 要么用root用户启动 , 要么在配置文件nginx.conf中将server下的listen端口改掉 , 因为在linux中端口号小于1024都是需要root权限的
- 解决nginx报错:nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied)
报错描述: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) 通过ansible远程给主机更换端口并重新启动ng ...
- Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) nginx 启动失败
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) nginx 启动失败 ...
- nginx: [emerg] open() "/var/run/nginx.pid" failed (13: Permission denied)
现象 1.centos6.9 用rpm包安装nginx 2.修改Nginx的多个配置文件和配置项 3.service nginx restart 报错: nginx: [emerg] open() & ...
- nginx bind() to 0.0.0.0:**** failed (13: Permission denied)
nginx 启动失败,日志里面报错信息如下: Starting nginx: nginx: [emerg] bind() to 0.0.0.0:**** failed (13: Permission ...
- 解决Nginx的connect() to 127.0.0.1:8080 failed (13: Permission denied) while connect
在进行Nginx+Tomcat 负载均衡的时候遇到了这个权限问题,在error.log日志中.我们能够看到例如以下: connect() to 127.0.0.1:8080 failed (13: P ...
随机推荐
- servlet中Request与response使用
服务器根据请求自动创建传入HttpServletRequest对象和HttpServletResponse对象 @Override protected void service(HttpServlet ...
- if a != None:
>>> x = 1 >>> not x False >>> x = [1] >>> not x False >>&g ...
- Python(二):做题函数记录
一,10进制 转 2,8,16进制 bin(<int>) ,oct(<int>),hex(<int>) 输出示例 '0b10011010010' '0o2322' ...
- 手动搭建的react环境中,关于图片引入的问题
react手动搭建的环境,require引进来图片不显示,网页src显示[object module] 解决方案 (1)import引进图片 import anli from './img/anli. ...
- 【资源分享】Undertale(传说之下)简体中文精品整合包
*----------------------------------------------[下载区]----------------------------------------------* ...
- Could not initialize class net.sourceforge.tess4j.TessAPI 解决方法
java.lang.NoClassDefFoundError: Could not initialize classnet.sourceforge.tess4j.TessAPI 主要原因是在Windo ...
- js加密(七)steam登录
1. url: https://store.steampowered.com/login/?redir=&redir_ssl=1 2. target: 登录 3. 分析 3.1 老样子,抓包, ...
- AI人工智能之基于OpenCV+face_recognition实现人脸识别
因近期公司项目需求,需要从监控视频里识别出人脸信息.OpenCV非常庞大,其中官方提供的人脸模型分类器也可以满足基本的人脸识别,当然我们也可以训练自己的人脸模型数据,但是从精确度和专业程度上讲Open ...
- opencv:图形绘制与填充
#include <opencv2/opencv.hpp> #include <iostream> using namespace cv; using namespace st ...
- 吴裕雄 python 神经网络TensorFlow实现LeNet模型处理手写数字识别MNIST数据集
import tensorflow as tf tf.reset_default_graph() # 配置神经网络的参数 INPUT_NODE = 784 OUTPUT_NODE = 10 IMAGE ...