Job for apache2.service failed because the control process exited with error code

August 14, 2018 21.1k views
Apache DigitalOcean Ubuntu 16.04

Output of systemctl status apache2.service
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
root@essayszone:~# systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Tue 2018-08-14 12:05:37 UTC; 4min 4s ago
Docs: man:systemd-sysv-generator(8)
Process: 8147 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Aug 14 12:05:37 essayszone.example.com apache2[8147]: * The apache2 configtest failed.
Aug 14 12:05:37 essayszone.example.com apache2[8147]: Output of config test was:
Aug 14 12:05:37 essayszone.example.com apache2[8147]: AH00526: Syntax error on line 1 of /home/admin/conf/web/essayszone.com.apache2.ssl.conf:
Aug 14 12:05:37 essayszone.example.com apache2[8147]: Invalid command 'nano', perhaps misspelled or defined by a module not included in the server configuration
Aug 14 12:05:37 essayszone.example.com apache2[8147]: Action 'configtest' failed.
Aug 14 12:05:37 essayszone.example.com apache2[8147]: The Apache error log may have more information.
Aug 14 12:05:37 essayszone.example.com systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 14 12:05:37 essayszone.example.com systemd[1]: Failed to start LSB: Apache2 web server.
Aug 14 12:05:37 essayszone.example.com systemd[1]: apache2.service: Unit entered failed state.
Aug 14 12:05:37 essayszone.example.com systemd[1]: apache2.service: Failed with result 'exit-code'.
root@essayszone:~#
Output of sudo apache2ctl configtest
root@essayszone:~# apache2ctl configtest
AH00526: Syntax error on line 1 of /home/admin/conf/web/essayszone.com.apache2.ssl.conf:
Invalid command 'nano', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

1 Answer

Hello friend!

It looks like there exists some bad configuration syntax in /home/admin/conf/web/essayszone.com.apache2.ssl.conf. This line is the key:

Aug 14 12:05:37 essayszone.example.com apache2[8147]: Invalid command 'nano', perhaps misspelled or defined by a module not included in the server configuration

Look for the word "nano" where it shouldn't be, try removing that and see if that has you in working order :)

Kind Regards,
Jarland

Have another answer? Share your knowledge.