Apache start error – “DocumentRoot must be a directory”

Fix for the “DocumentRoot must be a directory” error when changing the document root from default in the apache configuration file (httpd.conf)

I was going through this error for around 10 days now. I was setting up a new linux server for test on a Red Hat Linux Enterprise Edition 5. I changed the documentroot from “/etc/httpd” to “/web/portal” and when I restarted the apache server it gave me the error saying “DocumentRoot must be a directory”. I made sure I had the permissions right on the folder and the folder existed but the error seemed to persist.

I went through many forums and then came across this post. The solution was to make sure the Security settings for the linux system were setup properly. So what was needed was to adjust the setting in the security level settings using the command system-config-securitylevel (or redhat-config-securitylevel) and then the server started without any problem.