环境:

虚拟机 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. AcWing 868. 筛质数 线性筛法

    #include <iostream> #include <algorithm> using namespace std; ; int primes[N], cnt; bool ...

  2. Git提交时提示“Please make sure you have the correct access rights and the repository exists.”的解决方法

    1.首先打开Git Bash设置名字和邮箱: git config --global user.name "你的名字" git config --global user.email ...

  3. 【游戏体验】Shoot'm(暴打火柴人)

    >>>点此处可试玩无敌版<<< 注意,本游戏含有少量暴力元素,13岁以下的儿童切勿尝试本款游戏 生活有压力,学习不如意,你可以尝试这款游戏发泄心中的不满 个人测评 ...

  4. Day1 面向对象编程与Java核心类

    this变量 在方法内部,可以使用一个隐含的变量this,它始终指向当前实例.如果没有命名冲突,可以省略this. 但是,如果有局部变量和字段重名,那么局部变量优先级更高,就必须加上this. 构造方 ...

  5. Go时间

    package main import ( "time" "fmt" "math/rand" ) func main() { /* time ...

  6. iOS 自动化打包发布(Fastlane+ Jenkins+蒲公英)

    安装 Xcode 命令行工具:xcode-select --install 安装 fastlane:sudo gem install fastlane --verbose 安装成功后查看版本:fast ...

  7. LeetCode 42接雨水 按行求解(差分+排序)

    按行求解的思路比较清晰明了,但是这个方法的复杂度高达O(heightSize*sum(height[i])),几乎高达O(N^2). 但是也并不是不可以解决,经观察我们可以发现,这个算法的缺点在于要遍 ...

  8. bootstrap下拉选择框倒三角所占宽度

    <select id="edit" class="form-control" style="width:42%;padding-right: 3 ...

  9. makefile的书写

    工作中会遇到makefile的书写,有必要做一些笔记.尽管网上有”万能模板“可以使用,但我觉得还是有必要从最基础的写起. 平常在windows下开发,不知道自己用过makefile,其实大部分IDE里 ...

  10. 【转】Docker网络模式--默认模式bridge模式

    一 引言 当 Docker 启动时,会自动在主机上创建一个名为 docker0 虚拟网桥,这实际上就是 Linux 的一个 bridge,可以理解为一个软件交换机.它会在挂载到它的网口之间进行转发.系 ...