apache2 configtest 失败,输出“未加载 MPM”。

Tas*_*ara 3 networking apache2 14.04

root@tasnim:/home/tara# service apache2 restart
 * Restarting web server apache2                                         [fail] 
 * The apache2 configtest failed.
Run Code Online (Sandbox Code Playgroud)

配置测试的输出是:

AH00534: apache2: Configuration error: No MPM loaded.
Action 'configtest' failed.
Run Code Online (Sandbox Code Playgroud)

使用

sudo a2enmod mpm_prefork
service apache2 restart
Run Code Online (Sandbox Code Playgroud)

我有:

root@tasnim:/home/tara# service apache2 restart
 * Restarting web server apache2                                  [fail] 
 * The apache2 configtest failed.
Run Code Online (Sandbox Code Playgroud)

配置测试的输出是:

AH00526: Syntax error on line 156 of /etc/apache2/apache2.conf:
Invalid command 'Require', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
Run Code Online (Sandbox Code Playgroud)

然后我打开/etc/apache2/apache2.conf文件并得到:

//access here, or in any related virtual host.
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied //this is line 156
</Directory>
Run Code Online (Sandbox Code Playgroud)

使用

 apt-cache policy apache2
Run Code Online (Sandbox Code Playgroud)

我有:

root@tasnim:/home/tara# apt-cache policy apache2
apache2:
Installed: 2.4.7-1ubuntu4.4
Candidate: 2.4.7-1ubuntu4.4
Version table:
*** 2.4.7-1ubuntu4.4 0
    500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
    500 http://archive.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
    100 /var/lib/dpkg/status
 2.4.7-1ubuntu4 0
    500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
Run Code Online (Sandbox Code Playgroud)

使用

 a2query -v
Run Code Online (Sandbox Code Playgroud)

我有:

root@tasnim:/home/tara# a2query -v
2.4.7
Run Code Online (Sandbox Code Playgroud)

小智 5

我有同样的问题,例如:

Starting web server apache2 
* The apache2 configtest failed. 
Output of config test was: apache2: 
Syntax error on line 140 of /etc/apache2/apache2.conf: 
Syntax error on line 2 of /etc/apache2/mods-enabled/mpm_itk.load: 
Cannot load /usr/lib/apache2/modules/mpm_itk.so into server: 
/usr/lib/apache2/modules/mpm_itk.so: cannot open shared object file:
No such file or directory Action 'configtest' failed. 
The Apache error log may have more information.
Run Code Online (Sandbox Code Playgroud)

我试试这个:apt-get install libapache2-mpm-itk所以我解决了我的问题,重新安装丢失的文件以便我可以恢复。

谢谢我希望你们能得到解决方案。