我试图安装 SSL 脚本以在本地服务器上运行 HTTPS,但最终却破坏了 Apache,现在它返回了以下信息:
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
输出systemctl status apache2.service
:
tales@tales-ubuntu1610:~$ systemctl status apache2.service
●apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; generated; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since seg 2016-12-12 10:47:30 BRST; 2min 48s ago
Docs: man:systemd-sysv-generator(8)
Process: 15802 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
dez 12 10:47:30 tales-ubuntu1610 apache2[15802]: * The apache2 configtest failed.
dez 12 10:47:30 tales-ubuntu1610 apache2[15802]: Output of configtest was:
dez 12 10:47:30 tales-ubuntu1610 apache2[15802]: AH00526: Syntax error on line 49 of /etc/apache2/sites-enabled/000-default.conf:
dez 12 10:47:30 tales-ubuntu1610 apache2[15802]: SSLCertificateFile: file '/etc/apache2/ssl/phpit.pem' does not exist or is empty
dez 12 10:47:30 tales-ubuntu1610 apache2[15802]: Action 'configtest' failed.
dez 12 10:47:30 tales-ubuntu1610 apache2[15802]: The Apache error log may have more information.
dez 12 10:47:30 tales-ubuntu1610 systemd[1]: apache2.service: Control process exited, code=exited status=1
dez 12 10:47:30 tales-ubuntu1610 systemd[1]: Failed to start LSB: Apache2 web server.
dez 12 10:47:30 tales-ubuntu1610 systemd[1]: apache2.service: Unit entered failed state.
dez 12 10:47:30 tales-ubuntu1610 systemd[1]: apache2.service: Failed with result 'exit-code'.
输出journalctl -xe
:
tales@tales-ubuntu1610:~$ journalctl -xe
dez 12 10:47:30 tales-ubuntu1610 apache2[15802]: The Apache error log may have more information.
dez 12 10:47:30 tales-ubuntu1610 systemd[1]: apache2.service: Control process exited, code=exited status=1
dez 12 10:47:30 tales-ubuntu1610 systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: A unidade apache2.service falhou
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A unidade apache2.service falhou.
--
-- O resultado é failed.
dez 12 10:47:30 tales-ubuntu1610 systemd[1]: apache2.service: Unit entered failed state.
dez 12 10:47:30 tales-ubuntu1610 systemd[1]: apache2.service: Failed with result 'exit-code'.
dez 12 10:47:30 tales-ubuntu1610 sudo[15759]: pam_unix(sudo:session): session closed for user root
dez 12 10:47:48 tales-ubuntu1610 wpa_supplicant[1084]: wlp2s0: WPA: Group rekeying completed with 00:1d:d5:a9:0b:20 [GTK=CCMP]
dez 12 10:49:43 tales-ubuntu1610 dbus-daemon[1526]: Activating service name='com.ubuntu.sso'
dez 12 10:49:43 tales-ubuntu1610 dbus-daemon[1526]: Successfully activated service 'com.ubuntu.sso'
dez 12 10:49:45 tales-ubuntu1610 NetworkManager[859]: <warn> [1481546985.3886] device (wlp2s0): activation-stage: schedule activate_stage5_ip6_confi…
dez 12 10:50:22 tales-ubuntu1610 gnome-screensho[15879]: Unable to select area using GNOME Shell's builtin screenshot interface, resorting to fallbac…
dez 12 10:50:35 tales-ubuntu1610 dbus[814]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.host…
dez 12 10:50:35 tales-ubuntu1610 systemd[1]: Starting Hostname Service...
-- Subject: Unidade systemd-hostnamed.service sendo iniciado
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A unidade systemd-hostnamed.service está sendo iniciada.
dez 12 10:50:35 tales-ubuntu1610 gvfsd-trash[2387]: send_infos_cb: Nenhuna interface "org.gtk.vfs.Enumerator" no objeto no caminho /org/gtk/vfs/clien…
dez 12 10:50:35 tales-ubuntu1610 gvfsd-trash[2387]: send_infos_cb: Nenhuna interface "org.gtk.vfs.Enumerator" no objeto no caminho /org/gtk/vfs/clien…
dez 12 10:50:35 tales-ubuntu1610 gvfsd-trash[2387]: send_infos_cb: Nenhuna interface "org.gtk.vfs.Enumerator" no objeto no caminho /org/gtk/vfs/clien…
dez 12 10:50:35 tales-ubuntu1610 gvfsd-trash[2387]: send_infos_cb: Nenhuna interface "org.gtk.vfs.Enumerator" no objeto no caminho /org/gtk/vfs/clien…
dez 12 10:50:35 tales-ubuntu1610 gvfsd-trash[2387]: send_infos_cb: Nenhuna interface "org.gtk.vfs.Enumerator" no objeto no caminho /org/gtk/vfs/clien…
dez 12 10:50:35 tales-ubuntu1610 gvfsd-trash[2387]: send_infos_cb: Nenhuna interface "org.gtk.vfs.Enumerator" no objeto no caminho /org/gtk/vfs/clien…
dez 12 10:50:35 tales-ubuntu1610 gvfsd-trash[2387]: send_done_cb: Nenhuna interface "org.gtk.vfs.Enumerator" no objeto no caminho /org/gtk/vfs/client…
dez 12 10:50:35 tales-ubuntu1610 dbus[814]: [system] Successfully activated service 'org.freedesktop.hostname1'
dez 12 10:50:35 tales-ubuntu1610 systemd[1]: Started Hostname Service.
-- Subject: Unidade systemd-hostnamed.service concluiu a inicialização
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A unidade systemd-hostnamed.service concluiu a inicialização.
--
-- The start-up result is done.
dez 12 10:50:46 tales-ubuntu1610 zeitgeist-datah[2342]: zeitgeist-datahub.vala:212: Error during inserting events: GDBus.Error:org.gnome.zeitgeist.En…
我正在使用 Ubuntu 16.10。提前非常感谢。
答案1
根据您收到的错误消息,证书文件不在您告诉 Apache 的位置,或者 Apache 无法读取它:
SSLCertificateFile: file '/etc/apache2/ssl/phpit.pem' does not exist or is empty
检查文件路径是否pem
正确,文件是否包含有效证书以及是否具有适当的权限以供 Apache 读取。
一般来说,用英语发帖是个好主意。如果错误消息不是英文的,我就无法回答你的问题了。另外,请将任何消息复制并粘贴到你的问题中,而不是链接无法搜索的图像。