Question

Apache Server not starting centos 7

Hi after i added IncludeOptional sites-enabled/*.conf to /etc/httpd/conf/httpd.conf i have been getting this error Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. here is thesystemctl status httpd.service -l

 httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-03-03 04:00:31 EST; 1min 25s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 2153 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 2152 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 2152 (code=exited, status=1/FAILURE)

Mar 03 04:00:31 centos-512mb-sfo1-01 systemd[1]: Starting The Apache HTTP Server...
Mar 03 04:00:31 centos-512mb-sfo1-01 httpd[2152]: httpd: Syntax error on line 354 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/sites-enabled/example2.com.conf: No such file or directory
Mar 03 04:00:31 centos-512mb-sfo1-01 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Mar 03 04:00:31 centos-512mb-sfo1-01 kill[2153]: kill: cannot find process ""
Mar 03 04:00:31 centos-512mb-sfo1-01 systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 03 04:00:31 centos-512mb-sfo1-01 systemd[1]: Failed to start The Apache HTTP Server.
Mar 03 04:00:31 centos-512mb-sfo1-01 systemd[1]: Unit httpd.service entered failed state.
Mar 03 04:00:31 centos-512mb-sfo1-01 systemd[1]: httpd.service failed.

i have tried reinstalling httpd but it did not resolve the issue.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @PaulSarda!

Take a look at this line of the log:

Mar 03 04:00:31 centos-512mb-sfo1-01 httpd[2152]: httpd: Syntax error on line 354 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/sites-enabled/example2.com.conf: No such file or directory

I’m guessing that /etc/httpd/sites-enabled/example2.com.conf is a symlink. If you run the following command:

ls -lah /etc/httpd/sites-enabled/example2.com.conf

it should output some info about the file and show you what it’s pointing to if it is indeed a symlink. Make sure that the path is valid and is of a file that does exist. If it isn’t, you can just delete it and recreate it properly:

ln -s /etc/httpd/sites-available/example2.com.conf /etc/httpd/sites-enabled/example2.com.conf

Job for httpd.service failed , after systemctl reload httpd, anyone can help?

<VirtualHost *:80> ServerName www.YOURDOMAIN.COM ServerAlias YOURDOMAIN.COM DocumentRoot /var/www/YOURDOMAIN.COM/public_html ErrorLog /var/www/YOURDOMAIN.COM/error.log CustomLog /var/www/YOURDOMAIN.COM/requests.log combined

DocumentRoot /var/www/YOURDOMAIN.COM/public_html
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/YOURDOMAIN.COM/public_html>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

</VirtualHost>