Issue with httpd configuration in Apache for Virtual Hosts

AgentJ asked:


  • Trying to use virtual hosting on an old computer to serve web content on my home network over different domains linked to the same ip address by following a tutorial.

  • After following the tutorial, I get the error:

    $sudo service httpd restart
    $Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details
  • After reviewing systemctl and journalctl’s output as directed, forum reading and going through stuff, find that commenting out the following line in /etc/httpd/conf/httpd.conf allows me to start httpd:

    IncludeOptional sites-enabled/*.conf
  • I believe something is wrong with the directory that is symbolically linked to sites-enabled, but can’t figure out what against the tutorial. All information is posted below.

Necessary Information

  • Link to tutorial I’m following

  • Version of Apache: 2.4.6

  • Files in /etc/httpd/sites-available (sites-enabled symlinked to this dir)

  • contents

      DocumentRoot /var/www/
      ErrorLog /var/www/
      CustomLog /var/www/ combined

The contents of are the same except with “example2” replacing every instant of “example”

Please let me know of any other files or output needed to help troubleshoot this.

My answer:

This is happening because you have an error in one of your configuration files. Run apachectl -t to find it.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.