VPS侦探论坛

 找回密码
 注册
查看: 3792|回复: 4

安装LNMPA并使用一些天后,服务器重启后,httpd不运行, error信息:httpd: bad user name apache

[复制链接]
发表于 2016-6-30 21:53:10 | 显示全部楼层 |阅读模式

军哥, 安装LNMPA并使用一些天后,服务器重启后,httpd不运行, 输入命令: lnmp restart, 获得error信息:Starting httpd: httpd: bad user name apache. 我该怎么办?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-7-1 01:45:00 | 显示全部楼层


刚才试了下,命令:/usr/local/apache/bin/apachectl start, 结果httpd能运行,这是怎么回事?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-7-1 08:46:46 | 显示全部楼层

grep ^User /etc/httpd/conf/httpd.conf
看一下
你肯定是吧httpd.conf里的运行用户从www改成了apache
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-7-1 11:17:09 | 显示全部楼层



军哥, 我输入命令: grep ^User /etc/httpd/conf/httpd.conf, 结果确实显示 : apache.
但是我从没修改过/etc/httpd/conf/httpd.conf, 我stat命令去查看/etc/httpd/conf/httpd.conf文件,显示修改日期是我安装LNMPA时的时间.
#stat /etc/httpd/conf/httpd.conf
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2016-06-30 18:22:35.000000000 +0800
Modify: 2016-02-04 15:40:24.000000000 +0800
Change: 2016-05-26 15:40:33.000000000 +0800

我该如何去修正这个错误?
方法1. vim /etc/httpd/conf/httpd.conf, 把User apache和Group apache修改为User www和Group www ?
方法2. groupadd apache和useradd -g apache apache?

谢谢军哥.
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-7-1 15:04:48 | 显示全部楼层

回复 4# 的帖子


你肯定是通过其他方式安装了其他的apache,lnmpa的配置文件在 /usr/local/apache/conf/httpd.conf

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-29 11:31 , Processed in 0.027519 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表