Apache won't start

Apache won't start. Approximately 40 virtuals on the server. Disabled a few likely culprits but no joy. Apache gives error.

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

There are no new entries in the Apache error logs for this whole day. I thought that is odd. Trying to start with command line give this:

<

p> systemd[1]: Starting The Apache HTTP Server...
httpd[14232]: AH00526: Syntax error on line 1622 of /etc/httpd/conf/httpd.conf:
Invalid command 'PerlSetVar', perhaps misspelled or defined by a module not included in th...uration
httpd.service: main process exited, code=exited, status=1/FAILURE
Failed to start The Apache HTTP Server

<

p> The line 1622 is in the last lines of the config file for the last virtual server. Removing the entire virtual server config does not allow the apache server to restart. How best to debug and figure out the problem? Virtualmin logs for that virtual are:

<

p>OpenSSL/1.0.1e-fips mod_fcgid/2.3.9 PHP/5.4.16 SVN/1.7.14 (internal dummy connection)

<

p>This one has me confused - suggestions welcome.

Status: 
Closed (fixed)

Comments

Howdy -- as a quick way to get Apache back up and running, I would suggest editing "/etc/httpd/conf/httpd.conf", and on line 1622, comment out the line beginning with "PerlSetVar".

After then, see if you're then able to start Apache.

Always up for a quick way but I did that. In fact that is the only thing I could think to do. I took out that virtual server config section of the file and tried to restart. Same error.

Is it the same error, but a different line number?

There may be a few instances of that which you'd need to comment out.

I finally found my way back to the error having accomplished nothing in these few hours. Except maybe get further away. Manually editing files when you don't know what you are doing - it can be a way to dig a hole so damn deep you can't climb out. Yes, I keep a copy. I hope. But I have been sick for a few days. Imagine you were working on the stupidest day of your life, then divided your intelligence in half and that is me today. But I don't have a choice because I have dozens of sites down. So here is the different error.

Jun 07 16:52:24 tango.securewebs.com systemd[1]: Starting The Apache HTTP Server... Jun 07 16:52:24 tango.securewebs.com httpd[24797]: httpd: Syntax error on line 1626 of /etc/httpd/conf/httpd.conf: Expected bu.../Files> Jun 07 16:52:24 tango.securewebs.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE Jun 07 16:52:24 tango.securewebs.com kill[24799]: kill: cannot find process "" Jun 07 16:52:24 tango.securewebs.com systemd[1]: httpd.service: control process exited, code=exited status=1 Jun 07 16:52:24 tango.securewebs.com systemd[1]: Failed to start The Apache HTTP Server. Jun 07 16:52:24 tango.securewebs.com systemd[1]: Unit httpd.service entered failed state. Jun 07 16:52:24 tango.securewebs.com systemd[1]: httpd.service failed.

Replaced with the original file that I carefully saved and got the very same error. Now this is getting scary. I am running out of ideas.

It says on the second line of the error that it expects bu.../Files> but it is truncated and I don't know what that means? Anybody have a thought?

Jun 07 16:52:24 tango.securewebs.com systemd[1]: Starting The Apache HTTP Server... Jun 07 16:52:24 tango.securewebs.com httpd[24797]: httpd: Syntax error on line 1626 of /etc/httpd/conf/httpd.conf: Expected bu.../Files> Jun 07 16:52:24 tango.securewebs.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE Jun 07 16:52:24 tango.securewebs.com kill[24799]: kill: cannot find process "" Jun 07 16:52:24 tango.securewebs.com systemd[1]: httpd.service: control process exited, code=exited status=1 Jun 07 16:52:24 tango.securewebs.com systemd[1]: Failed to start The Apache HTTP Server. Jun 07 16:52:24 tango.securewebs.com systemd[1]: Unit httpd.service entered failed state. Jun 07 16:52:24 tango.securewebs.com systemd[1]: httpd.service failed. Hint: Some lines were ellipsized, use -l to show in full.

Finally got it. A syntax error. Not even sure exactly what line it was but I suspect it was the ---- PerlSetVar SSL 1---- The strange thing is restarting apache from the command line kept giving me the same error - or at least three times after a file change. The last thing was to restart with virtualmin control panel and it did it! Thank God ---- now where was that bottle of whiskey?

I'm glad you were able to figure it out! And I hope you're able to figure out where the whiskey is kept :-)

I have the same issue andreychek please check my log let me know what to do?