Solution – Apache / HTTP Failed to Start Because of CustomLog Syntax Error in httpd.conf

apache-fixing

I was recently working on a server with CentOS 6 installed 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 failing to start with below 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)

Solution

Step 1:
Login to your server as root via SSH.

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

nano /etc/httpd/conf/httpd.conf

Step 3:
Go to the line which is producing error message. It Should be something like below.

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

Step 4:
Change above line to below line.

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

Step 5:
Save the file using: ctrl + O
Exit nano text editor: ctrl + X

Step 6:
Start Apache / http using below command.

service httpd start

Done!! Apache should start and run now.

Our Top Rated Host

Related Posts