Apache更改默认用户

问题描述 投票:0回答:2

我希望在名为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
2个回答
1
投票

只有'root'用户可以将连接绑定到小于1024的端口。有关更多信息,请访问here。将apache配置为使用高于1024的different端口号或以root用户身份使用sudo。不推荐以后的选项。


0
投票

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

 User ${APACHE_RUN_USER}
 Group ${APACHE_RUN_GROUP}
© www.soinside.com 2019 - 2024. All rights reserved.