DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

Apache service not starting, getting error DocumentRoot must be a directory

February 8, 2018 DbAppWeb Admin

Problem

I have installed Apache 2.2.3 on my web server. After installation, I made some changes in httpd.conf file and created the required directory for DocumentRoot but when I tried to start the HTTPD service I got the below error:

[root@dbappweb ~]# service httpd start
Starting httpd: Syntax error on line 302 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[FAILED]

DocumentRoot is defined in the httpd.conf file was a directory and when I checked the httpd syntax then I got that there was no syntax error as shown below.

[root@dbappweb ~]# httpd -t
Syntax OK

Reason

Starting of httpd service was being failed because the SELinux feature was Enforcing, it can be checked using the command getenforce.

[root@dbappweb ~]# getenforce
Enforcing

Solution

To resolve the above issue you need to disable the SELinux feature. To disable the SELinux feature you need to edit the /etc/selinux/config file. Change the value of SELINUX from enforcing to disabled. After changing the value you need to reboot the server.

[root@dbappweb ~]# vi /etc/selinux/config

.
.

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

.
.

Once the server is rebooted these changes will come into effect which can be verified using the command getenforce and its output should be disabled.

[root@dbappweb ~]# getenforce
Disabled

Now You can start the apache service successfully.

[root@dbappweb ~]# service httpd start
Starting httpd: [ OK ]

Note: I faced the above problem on RHEL 5.8 while installing the Apache 2.2.3

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
Prev Article
Next Article
Tags:Apache 2.2.3 Linux Sys Admin System Security

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com