on centos when I enter

service httpd start or restart

server gives

Starting httpd: httpd: bad user name apache

I tried to add apache user and group, reinstalled httpd so many times but it did not worked either.

migrated from stackoverflow.com Dec 28 '12 at 19:11

This question came from our site for professional and enthusiast programmers.

  • when you tried to create apache user were you able to create it? or that failed too? – Hanky Panky Dec 28 '12 at 13:56
  • I can create the user. Also I checked it from /etc/passwd and /etc/group files – irukeru Dec 28 '12 at 13:57
  • Try creating it from init. cd /etc/init.d; sudo ./httpd start A bit of googling revealed that a lot of people have problems with it overriding the config settings with environment variables. – scragar Dec 28 '12 at 13:58
  • I tried this too but it gives the same error :( I googled this error and non of the solutions helped me. I changed file permissions, config file etc :/ – irukeru Dec 28 '12 at 14:17
  • if no solution helps, uninstall and install it again. If still fails, try to build it on your own (not install via yum,.. but build from source) – xhudik Dec 28 '12 at 14:21

Run config test

[root@9001 conf_0.d]# /etc/init.d/httpd configtest
Syntax OK

Check what users and group set in httpd.conf

User apache
Group apache

Disable SELinux if its enabled.

  • 1
    disabling SELinux solved the problem. thanks a lot =)) – irukeru Dec 28 '12 at 16:07
  • but when I reboot server I have to disable SELinux again. what should I do for this problem ? – irukeru Dec 28 '12 at 18:17
  • Disable permanently selinux edit /etc/sysconfig/selinux SELINUX=disabled – Satish Dec 28 '12 at 18:39

you need to check your apache entire in below config file


in Redhat 7 entire should be below

/etc/passwd > apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin
/etc/group > apache:x:48:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy