Ubuntu 16.04 重新启动apache2时出错

Ubuntu 16.04 重新启动apache2时出错

我尝试重新启动 apache2 但出现以下错误:

root@vps50217:~# service apache2 restart
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
root@vps50217:~# systemctl
  UNIT                                    LOAD   ACTIVE     SUB       DESCRIPTION
  dev-simfs.device                        loaded activating tentative dev-simfs.device
  sys-devices-virtual-net-venet0.device   loaded active     plugged   /sys/devices/virtual/net/venet0
  sys-subsystem-net-devices-venet0.device loaded active     plugged   /sys/subsystem/net/devices/venet0
  -.mount                                 loaded active     mounted   /
  run-shm.mount                           loaded active     mounted   /run/shm
  systemd-ask-password-console.path       loaded active     waiting   Dispatch Password Requests to Console Directory Watch
  systemd-ask-password-wall.path          loaded active     waiting   Forward Password Requests to Wall Directory Watch
  init.scope                              loaded active     running   System and Service Manager
● apache2.service                         loaded failed     failed    LSB: Apache2 web server
  console-getty.service                   loaded active     running   Console Getty
  cron.service                            loaded active     running   Regular background program processing daemon
  dbus.service                            loaded active     running   D-Bus System Message Bus
  [email protected]                      loaded active     running   Getty on tty2
  [email protected]                     loaded active     exited    ifup for venet0
  modules_dep.service                     loaded active     exited    LSB: modules.dep creation.
  mysql.service                           loaded active     running   MySQL Community Server
  networking.service                      loaded active     exited    Raise network interfaces
  php7.0-fpm.service                      loaded active     running   The PHP 7.0 FastCGI Process Manager
  postfix.service                         loaded active     running   LSB: Postfix Mail Transport Agent
  quota.service                           loaded active     exited    Initial Check File System Quotas
  rc-local.service                        loaded active     exited    /etc/rc.local Compatibility
  rpcbind.service                         loaded active     running   RPC bind portmap service
  rsyslog.service                         loaded active     running   System Logging Service
  saslauthd.service                       loaded active     running   LSB: saslauthd startup script
  ssh.service                             loaded active     running   OpenBSD Secure Shell server
  systemd-hwdb-update.service             loaded active     exited    Rebuild Hardware Database
  systemd-journal-flush.service           loaded active     exited    Flush Journal to Persistent Storage
  systemd-journald.service                loaded active     running   Journal Service
  systemd-random-seed.service             loaded active     exited    Load/Save Random Seed
  systemd-remount-fs.service              loaded active     exited    Remount Root and Kernel File Systems
● systemd-sysctl.service                  loaded failed     failed    Apply Kernel Variables
  systemd-tmpfiles-setup.service          loaded active     exited    Create Volatile Files and Directories
  systemd-udev-trigger.service            loaded active     exited    udev Coldplug all Devices
  systemd-udevd.service                   loaded active     running   udev Kernel Device Manager
  systemd-update-utmp.service             loaded active     exited    Update UTMP about System Boot/Shutdown
  systemd-user-sessions.service           loaded active     exited    Permit User Sessions
  xinetd.service                          loaded active     running   LSB: Starts or stops the xinetd daemon.
  -.slice                                 loaded active     active    Root Slice
  system-getty.slice                      loaded active     active    system-getty.slice
  system.slice                            loaded active     active    System Slice
  dbus.socket                             loaded active     running   D-Bus System Message Bus Socket
root@vps50217:~# systemctl status apache2
  Jun 28 15:05:14 vps50217 apache2[18059]:  *
  Jun 28 15:05:14 vps50217 apache2[18059]:  * The apache2 configtest failed.
  Jun 28 15:05:14 vps50217 apache2[18059]: Output of config test was:
  Jun 28 15:05:14 vps50217 apache2[18059]: apache2: Syntax error on line 7 of /etc/apache2/apache2.conf: Could not open configuration file /etc/phpmyadmin/apache.conf: No
  Jun 28 15:05:14 vps50217 apache2[18059]: Action 'configtest' failed.
  Jun 28 15:05:14 vps50217 apache2[18059]: The Apache error log may have more information.
  Jun 28 15:05:14 vps50217 systemd[1]: apache2.service: Control process exited, code=exited status=1
  Jun 28 15:05:14 vps50217 systemd[1]: Failed to start LSB: Apache2 web server.
  Jun 28 15:05:14 vps50217 systemd[1]: apache2.service: Unit entered failed state.
  Jun 28 15:05:14 vps50217 systemd[1]: apache2.service: Failed with result 'exit-code'.

输出systemctl status apache2

Jun 28 15:05:14 vps50217 apache2[18059]:  *
Jun 28 15:05:14 vps50217 apache2[18059]:  * The apache2 configtest failed.
Jun 28 15:05:14 vps50217 apache2[18059]: Output of config test was:
Jun 28 15:05:14 vps50217 apache2[18059]: apache2: Syntax error on line 7 of /etc/apache2/apache2.conf: Could not open configuration file /etc/phpmyadmin/apache.conf: No
Jun 28 15:05:14 vps50217 apache2[18059]: Action 'configtest' failed.
Jun 28 15:05:14 vps50217 apache2[18059]: The Apache error log may have more information.
Jun 28 15:05:14 vps50217 systemd[1]: apache2.service: Control process exited, code=exited status=1
Jun 28 15:05:14 vps50217 systemd[1]: Failed to start LSB: Apache2 web server.
Jun 28 15:05:14 vps50217 systemd[1]: apache2.service: Unit entered failed state.
Jun 28 15:05:14 vps50217 systemd[1]: apache2.service: Failed with result 'exit-code'.

答案1

错误信息表示/etc/phpmyadmin/apache.conf缺少该文件。该文件由软件包提供phpmyadmin。可以使用以下命令安装:

sudo apt install phpmyadmin

相关内容