httpd: bad user name apache

35,716

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.

Share:
35,716

Related videos on Youtube

irukeru
Author by

irukeru

Updated on September 18, 2022

Comments

  • irukeru
    irukeru over 1 year

    on centos when I enter

    service httpd start or restart

    server gives

    Starting httpd: httpd: bad user name apache
                                                               [FAILED]
    

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

    • Admin
      Admin over 11 years
      when you tried to create apache user were you able to create it? or that failed too?
    • Admin
      Admin over 11 years
      I can create the user. Also I checked it from /etc/passwd and /etc/group files
    • Denis
      Denis over 11 years
      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.
    • Admin
      Admin over 11 years
      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 :/
    • Admin
      Admin over 11 years
      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)
    • Admin
      Admin over 11 years
      This may be what you are looking for: drjohnstechtalk.com/blog/2012/03/…
    • Admin
      Admin over 11 years
      I reinstall via yum so many times. I'll try building from source. thanks.
    • Fr0zenFyr
      Fr0zenFyr over 8 years
      Darn!! I can't believe that I made a mistake in group name called it Www-data instead of www-data... hope this check helps someone...
  • Admin
    Admin over 11 years
    but when I reboot server I have to disable SELinux again. what should I do for this problem ?
  • Admin
    Admin over 11 years
    Disable permanently selinux edit /etc/sysconfig/selinux SELINUX=disabled
  • Euli
    Euli almost 5 years
    Imo, disabling SELinux is not a good advice. At least explain, why SELinux could cause the problem.