Unable to Restart/Start CentOS After Adding httpd Conf Files


If you experiencing error when you’re adding a httpd conf file for your sites, specifically in /etc/httpd/sites-available directory and adding symbolic link in it. You got a problem when restarting your server from using service httpd restart command.

The error says:
Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.

And when you expand the error log, it outputs something:

httpd.service - The Apache HTTP Server
 Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
 Active: failed (Result: exit-code) since Thu 2018-04-19 17:40:30 UTC; 13s ago
 Docs: man:httpd(8)
 man:apachectl(8)
 Process: 10706 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
 Process: 10704 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 10704 (code=exited, status=1/FAILURE)

Apr 19 17:40:30 codefaq-centos-server systemd[1]: Starting The Apache HTTP Server...
Apr 19 17:40:30 codefaq-centos-server systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 19 17:40:30 codefaq-centos-server kill[10706]: kill: cannot find process ""
Apr 19 17:40:30 codefaq-centos-server systemd[1]: httpd.service: control process exited, code=exited status=1
Apr 19 17:40:30 codefaq-centos-server systemd[1]: Failed to start The Apache HTTP Server.
Apr 19 17:40:30 codefaq-centos-server systemd[1]: Unit httpd.service entered failed state.
Apr 19 17:40:30 codefaq-centos-server systemd[1]: httpd.service failed.

This error occur because you’re most likely migrated into a new server that are using latest CentOS version. On the latest CentOS, putting a log inside the /var/www directory is prohibited and the server will not allow it – that’s why you’re getting this error. Instead put it in the /var/log directoryyou have to change your .conf files of your website. Similar below:

<VirtualHost *:80>
 ServerAdmin webmaster@yourwebsite.com
 ServerName www.yourwebsite.com
 ServerAlias yourwebsite.com
 DocumentRoot /var/www/yourwebsite.com/public_html
 ErrorLog /var/log/yourwebsite.com-error.log
 CustomLog /var/log/yourwebsite.com-requests.log combined
 </VirtualHost>

<Directory /var/www/yourwebsite.com/public_html>
 Options FollowSymLinks
 AllowOverride All
 </Directory>

Like it? Share with your friends!

0

Comments 0

Your email address will not be published. Required fields are marked *

Unable to Restart/Start CentOS After Adding httpd Conf Files

log in

Captcha!

reset password

Back to
log in
Choose A Format
Gif
GIF format