环境:

虚拟机 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)的更多相关文章

  1. 解决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 ...

  2. 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) 原因如下: ...

  3. 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 安装 ...

  4. nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

    启动nginx时报这个错 , 要么用root用户启动 , 要么在配置文件nginx.conf中将server下的listen端口改掉 , 因为在linux中端口号小于1024都是需要root权限的

  5. 解决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 ...

  6. 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 启动失败 ...

  7. 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() & ...

  8. 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 ...

  9. 解决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 ...

随机推荐

  1. Multisim 中的一些快捷键

    1.镜像 Alt + Y 2.左转90° Ctrl + L 3.右转90° Ctrl + R

  2. 3.0 java学习网站

    1.http://www.rupeng.com/Courses/Index/51 2.https://www.zhihu.com/question/25255189

  3. 二次封装 Reponse,视图家族

    复习 """ 1.整体修改与局部修改 # 序列化 ser_obj = ModelSerializer(model_obj) # 反序列化,save() => cre ...

  4. [NLP]Transformer模型解析

    简介[2] Attention Is All You Need是2017年google提出来的一篇论文,论文里提出了一个新的模型,叫Transformer,这个结构广泛应用于NLP各大领域,是目前比较 ...

  5. Codeforces Round #624 (Div. 3) D. Three Integers

    You are given three integers a≤b≤ca≤b≤c . In one move, you can add +1+1 or −1−1 to any of these inte ...

  6. Linux - Shell - 字符串拼接

    概述 shell 的字符串拼接 1. 字符串声明 概述 字符串的基本操作 脚本 1 # 声明字符串 str01="str01" echo ${str01} # 单引号也可以 # 不 ...

  7. 传奇脚本中 SendMsg 编号说明

    0 1 2 3 4 5 60对全服人说1.发送普通红色广播信息. 2.发送普通红色广播信息,并显示NPC名称. 3.发送普通红色广播信息,并人物NPC名称. 4.在NPC头顶,显示普通说话信息. 5. ...

  8. java中的main方法参数String[] args的说明

    参数String[] args 的作用是在运行main方法时,在控制台输入参数 class Test{ public static void main(String[] args){ for(Stri ...

  9. Appium-测试失败后获取屏幕截图的方法

    最近一直在研究appium,偶尔的机会发现断言后获取屏幕截图.觉得这个方法不错,分享给大家 这样以后在遇到断言,想截图错误屏幕的时候,能够用的上. 1.首先需要2个类,一个是测试类(TestDropL ...

  10. 安慰奶牛Cheering up the Cow

    传送门 一次a就很开心 可以当作kruskal模板题(orz --------------------------------------------------------------------- ...