使用“a2ensite MyDomain.com.conf”并运行“service apache2 reload”后出现错误

使用“a2ensite MyDomain.com.conf”并运行“service apache2 reload”后出现错误

我正在使用托管在 Linode 上的 Ubuntu 16.04 LTS。

我想要的是使用后重新加载 apache2 。但是使用后重新加载 apache2 时a2ensite MyDamain.com.conf出现错误a2ensite MyDomain.com.confservice apache2 reload

该命令后的错误是

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

当我使用时system 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: active (running) since Wed 2017-11-29 10:44:42 EST; 29min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 16126 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 15556 ExecReload=/etc/init.d/apache2 reload (code=exited, status=1/FAILURE)
  Process: 16148 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/apache2.service
           ├─16165 /usr/sbin/apache2 -k start
           ├─16168 /usr/sbin/apache2 -k start
           └─16169 /usr/sbin/apache2 -k start

Nov 29 10:44:41 hostname systemd[1]: Stopped LSB: Apache2 web server.
Nov 29 10:44:41 hostname systemd[1]: Starting LSB: Apache2 web server...
Nov 29 10:44:41 hostname apache2[16148]:  * Starting Apache httpd web server apache2
Nov 29 10:44:42 hostname apache2[16148]:  *
Nov 29 10:44:42 hostname systemd[1]: Started LSB: Apache2 web server.

以下是/var/log/apache2/error.log和的journalctl -u apache2.service输出:

[Wed Nov 29 09:18:18.391354 2017] [mpm_event:notice] [pid 2603:tid 140612271839104] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 09:18:18.391428 2017] [core:notice] [pid 2603:tid 140612271839104] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 09:19:16.891581 2017] [mpm_event:notice] [pid 2603:tid 140612271839104] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Nov 29 09:19:16.896943 2017] [mpm_event:notice] [pid 2603:tid 140612271839104] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 09:19:16.896954 2017] [core:notice] [pid 2603:tid 140612271839104] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 10:42:59.573821 2017] [mpm_event:notice] [pid 2603:tid 140612271839104] AH00491: caught SIGTERM, shutting down
[Wed Nov 29 10:43:48.125153 2017] [mpm_event:notice] [pid 16050:tid 140568317134720] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 10:43:48.125248 2017] [core:notice] [pid 16050:tid 140568317134720] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 10:44:40.835976 2017] [mpm_event:notice] [pid 16050:tid 140568317134720] AH00491: caught SIGTERM, shutting down
[Wed Nov 29 10:44:41.915837 2017] [mpm_event:notice] [pid 16165:tid 140038324930432] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 10:44:41.915935 2017] [core:notice] [pid 16165:tid 140038324930432] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 14:40:22.055349 2017] [mpm_event:notice] [pid 16165:tid 140038324930432] AH00491: caught SIGTERM, shutting down
[Wed Nov 29 14:41:33.755038 2017] [mpm_event:notice] [pid 20426:tid 139872130365312] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 14:41:33.755125 2017] [core:notice] [pid 20426:tid 139872130365312] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 14:41:38.205079 2017] [mpm_event:notice] [pid 20426:tid 139872130365312] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Nov 29 14:41:38.210405 2017] [mpm_event:notice] [pid 20426:tid 139872130365312] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 14:41:38.210417 2017] [core:notice] [pid 20426:tid 139872130365312] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 14:42:24.424726 2017] [mpm_event:notice] [pid 20426:tid 139872130365312] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Nov 29 14:42:24.429568 2017] [mpm_event:notice] [pid 20426:tid 139872130365312] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 14:42:24.429577 2017] [core:notice] [pid 20426:tid 139872130365312] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 14:51:13.673871 2017] [mpm_event:notice] [pid 20426:tid 139872130365312] AH00491: caught SIGTERM, shutting down
[Wed Nov 29 14:51:14.736870 2017] [mpm_event:notice] [pid 20855:tid 140107096328064] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 14:51:14.736939 2017] [core:notice] [pid 20855:tid 140107096328064] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 14:51:20.681637 2017] [mpm_event:notice] [pid 20855:tid 140107096328064] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Nov 29 14:51:20.686725 2017] [mpm_event:notice] [pid 20855:tid 140107096328064] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 14:51:20.686735 2017] [core:notice] [pid 20855:tid 140107096328064] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 15:48:46.861157 2017] [mpm_event:notice] [pid 20855:tid 140107096328064] AH00491: caught SIGTERM, shutting down
[Wed Nov 29 15:50:12.237275 2017] [mpm_event:notice] [pid 4423:tid 140346390390656] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 15:50:12.237757 2017] [core:notice] [pid 4423:tid 140346390390656] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 15:50:23.361181 2017] [mpm_event:notice] [pid 4423:tid 140346390390656] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Nov 29 15:50:23.366024 2017] [mpm_event:notice] [pid 4423:tid 140346390390656] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 15:50:23.366032 2017] [core:notice] [pid 4423:tid 140346390390656] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 15:54:31.116056 2017] [mpm_event:notice] [pid 4423:tid 140346390390656] AH00491: caught SIGTERM, shutting down
[Wed Nov 29 16:22:54.524680 2017] [mpm_event:notice] [pid 5595:tid 140625337571200] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 16:22:54.524760 2017] [core:notice] [pid 5595:tid 140625337571200] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 29 16:23:08.498668 2017] [mpm_event:notice] [pid 5595:tid 140625337571200] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Nov 29 16:23:08.503243 2017] [mpm_event:notice] [pid 5595:tid 140625337571200] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Nov 29 16:23:08.503252 2017] [core:notice] [pid 5595:tid 140625337571200] AH00094: Command line: '/usr/sbin/apache2'

和:

root@hostname:~#   journalctl -u apache2.service
-- Logs begin at Wed 2017-11-29 15:48:57 EST, end at Thu 2017-11-30 08:17:40 EST. --
Nov 29 15:48:58 hostname systemd[1]: Starting LSB: Apache2 web server...
Nov 29 15:48:58 hostname apache2[3475]:  * Starting Apache httpd web server apache2
Nov 29 15:48:58 hostname apache2[3475]:  *
Nov 29 15:48:58 hostname apache2[3475]:  * The apache2 configtest failed.
Nov 29 15:48:58 hostname apache2[3475]: Output of config test was:
Nov 29 15:48:58 hostname apache2[3475]: (2)No such file or directory: AH02291: Cannot acc
Nov 29 15:48:58 hostname apache2[3475]: AH00014: Configuration check failed
Nov 29 15:48:58 hostname apache2[3475]: Action 'configtest' failed.
Nov 29 15:48:58 hostname apache2[3475]: The Apache error log may have more information.
Nov 29 15:48:58 hostname systemd[1]: apache2.service: Control process exited, code=exited
Nov 29 15:48:58 hostname systemd[1]: Failed to start LSB: Apache2 web server.
Nov 29 15:48:58 hostname systemd[1]: apache2.service: Unit entered failed state.
Nov 29 15:48:58 hostname systemd[1]: apache2.service: Failed with result 'exit-code'.
Nov 29 15:50:00 hostname systemd[1]: Starting LSB: Apache2 web server...
Nov 29 15:50:01 hostname apache2[4328]:  * Starting Apache httpd web server apache2
Nov 29 15:50:01 hostname apache2[4328]:  *
Nov 29 15:50:01 hostname apache2[4328]:  * The apache2 configtest failed.
Nov 29 15:50:01 hostname apache2[4328]: Output of config test was:
Nov 29 15:50:01 hostname apache2[4328]: (2)No such file or directory: AH02291: Cannot acc
Nov 29 15:50:01 hostname apache2[4328]: AH00014: Configuration check failed
Nov 29 15:50:01 hostname apache2[4328]: Action 'configtest' failed.
Nov 29 15:50:01 hostname apache2[4328]: The Apache error log may have more information.
Nov 29 15:50:01 hostname systemd[1]: apache2.service: Control process exited, code=exited
Nov 29 15:50:01 hostname systemd[1]: Failed to start LSB: Apache2 web server.
Nov 29 15:50:01 hostname systemd[1]: apache2.service: Unit entered failed state.
Nov 29 15:50:01 hostname systemd[1]: apache2.service: Failed with result 'exit-code'.
Nov 29 15:50:12 hostname systemd[1]: Starting LSB: Apache2 web server...
Nov 29 15:50:12 hostname apache2[4406]:  * Starting Apache httpd web server apache2
Nov 29 15:50:13 hostname apache2[4406]:  *
Nov 29 15:50:13 hostname systemd[1]: Started LSB: Apache2 web server.
Nov 29 15:50:23 hostname systemd[1]: Reloading LSB: Apache2 web server.
Nov 29 15:50:23 hostname apache2[4505]:  * Reloading Apache httpd web server apache2
Nov 29 15:50:23 hostname apache2[4505]:  *
Nov 29 15:50:23 hostname systemd[1]: Reloaded LSB: Apache2 web server.
Nov 29 15:50:35 hostname systemd[1]: Reloading LSB: Apache2 web server.
Nov 29 15:50:35 hostname apache2[4599]:  * Reloading Apache httpd web server apache2
Nov 29 15:50:35 hostname apache2[4599]:  *
Nov 29 15:50:35 hostname apache2[4599]:  * The apache2 configtest failed. Not doing anyth
Nov 29 15:50:35 hostname apache2[4599]: Output of config test was:
Nov 29 15:50:35 hostname apache2[4599]: (2)No such file or directory: AH02291: Cannot acc
Nov 29 15:50:35 hostname apache2[4599]: AH00014: Configuration check failed
Nov 29 15:50:35 hostname apache2[4599]: Action 'configtest' failed.
Nov 29 15:50:35 hostname apache2[4599]: The Apache error log may have more information.
Nov 29 15:50:35 hostname systemd[1]: apache2.service: Control process exited, code=exited
Nov 29 15:50:35 hostname systemd[1]: Reload failed for LSB: Apache2 web server.
Nov 29 15:53:52 hostname systemd[1]: Reloading LSB: Apache2 web server.
Nov 29 15:53:52 hostname apache2[4621]:  * Reloading Apache httpd web server apache2
Nov 29 15:53:52 hostname apache2[4621]:  *
Nov 29 15:53:52 hostname apache2[4621]:  * The apache2 configtest failed. Not doing anyth
Nov 29 15:53:52 hostname apache2[4621]: Output of config test was:
Nov 29 15:53:52 hostname apache2[4621]: (2)No such file or directory: AH02291: Cannot acc
Nov 29 15:53:52 hostname apache2[4621]: AH00014: Configuration check failed

答案1

问题解决了,只是目标中的一个拼写错误MyDomain.com.conf

-_-

相关内容