HTTP failed to start because of syntax error in HTTPD.conf

We have recently installed CentOS 6 and trying to configure Apache virtual hosts to host several domains / websites without any control panel like cPanel.

But after editing /etc/httpd/conf/httpd.conf file for virtual hosts, Apache was fail to start with following error message:

Starting httpd: Syntax error on line 1008 of /etc/httpd/conf/httpd.conf:CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional “env=” clause (see docs)

To resolve this error, follow the steps below:

SSh into your server as an root user

Open /etc/httpd/conf/httpd.conf file in any text editor like nano.

Go to the line which is throughing error message. It Should be something like:

CustomLog /var/www/domain.com/requests.log

Change above line to below line.

CustomLog /var/www/domain.com/requests.log common

Save the file and exit the editor.

Start Apache / http using below command:

service httpd start

Done!! Apache should run now.