在Linux Mint中重新安装后,Apache2无法正常工作

时间:2019-06-22 11:59:42

标签: apache2 lamp linuxmint

我最近在Linux Mint操作的笔记本电脑中安装了PHP7的LAPM堆栈。现在,我想使用PHP5.6。无需搜索更多信息,我只是使用以下命令删除了LAMP堆栈的所有内容。

  • sudo apt-get purge phpmyadmin
  • sudo apt-get清除mysql-server apache2
  • sudo apt-get清除mysql
  • sudo apt-get purge php
  • sudo apt-get autoremove

然后,我使用whereis命令查找有关phpapachemysql的所有信息并手动删除。再次执行sudo apt-get autoremove命令。

现在,我重新启动笔记本电脑,以确保在安装LAMP堆栈时没有任何后台操作导致冲突。

我计划安装php 5.6和7.2的双重实例。这就是为什么我使用以下命令添加了新的PPA。

  • sudo add-apt-repository ppa:ondrej / php
  • sudo apt-get更新

现在,我尝试使用以下命令安装Apache:sudo apt-get install apache2,并在命令面板中找到以下错误脚本:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  apache2-data apache2-utils
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-data apache2-utils
0 upgraded, 3 newly installed, 0 to remove and 28 not upgraded.
Need to get 0 B/330 kB of archives.
After this operation, 1,718 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package apache2-utils.
(Reading database ... 283056 files and directories currently installed.)
Preparing to unpack .../apache2-utils_2.4.18-2ubuntu3.10_amd64.deb ...
Unpacking apache2-utils (2.4.18-2ubuntu3.10) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../apache2-data_2.4.18-2ubuntu3.10_all.deb ...
Unpacking apache2-data (2.4.18-2ubuntu3.10) ...
Selecting previously unselected package apache2.
Preparing to unpack .../apache2_2.4.18-2ubuntu3.10_amd64.deb ...
Unpacking apache2 (2.4.18-2ubuntu3.10) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (229-4ubuntu21.21) ...
Setting up apache2-utils (2.4.18-2ubuntu3.10) ...
Setting up apache2-data (2.4.18-2ubuntu3.10) ...
Setting up apache2 (2.4.18-2ubuntu3.10) ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● 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 Sat 2019-06-22 17:38:57 +06; 4ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4604 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Jun 22 17:38:57 microsolutionsbd apache2[4604]:  *
Jun 22 17:38:57 microsolutionsbd apache2[4604]:  * The apache2 configtest failed.
Jun 22 17:38:57 microsolutionsbd apache2[4604]: Output of config test was:
Jun 22 17:38:57 microsolutionsbd apache2[4604]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/a...
Jun 22 17:38:57 microsolutionsbd apache2[4604]: Action 'configtest' failed.
Jun 22 17:38:57 microsolutionsbd apache2[4604]: The Apache error log may have more information.
Jun 22 17:38:57 microsolutionsbd systemd[1]: apache2.service: Control process exited, code=exited status=1
Jun 22 17:38:57 microsolutionsbd systemd[1]: Failed to start LSB: Apache2 web server.
Jun 22 17:38:57 microsolutionsbd systemd[1]: apache2.service: Unit entered failed state.
Jun 22 17:38:57 microsolutionsbd systemd[1]: apache2.service: Failed with result 'exit-code'.
Hint: Some lines were ellipsized, use -l to show in full.
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.21) ...
Processing triggers for ufw (0.35-0ubuntu2) ...

使Apache工作的解决方案是什么?

0 个答案:

没有答案