【问题标题】:Apache Change Default UserApache 更改默认用户
【发布时间】:2015-04-06 02:53:50
【问题描述】:

我希望在名为 app_user 的用户下运行 apache。为此,我在 httpd.conf 文件中更改了以下内容

User app_user
Group app_user

app_user 是此服务器上的有效用户和组。

app_user 有正确的权限写入 /var/log/httpd 目录。

现在当我启动 apache 时,它​​给了我这个错误。

[app_user@localhost conf]$ service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

感谢您对此的帮助。

【问题讨论】:

    标签: apache httpd.conf


    【解决方案1】:

    只有“root”用户可以将连接绑定到小于 1024 的端口。更多信息here。将 apache 配置为使用高于 1024 的 different 端口号或 sudo 作为 root 用户。不推荐以后的选项。

    【讨论】:

      【解决方案2】:

      root 应该启动 apache 主进程以绑定较低的端口,但是,如果您想为子进程使用不同的用户/组,您可以通过 APACHE_RUN_USERAPACHE_RUN_GROUP 环境配置变量。 检查/etc/apache2/apache2.conf:

       User ${APACHE_RUN_USER}
       Group ${APACHE_RUN_GROUP}
      

      【讨论】:

        猜你喜欢
        • 2011-10-31
        • 1970-01-01
        • 2016-05-30
        • 1970-01-01
        • 2013-09-19
        • 2012-09-10
        • 2021-02-18
        • 2011-11-10
        • 1970-01-01
        相关资源
        最近更新 更多