apache2 配置测试失败。没有执行任何操作

apache2 配置测试失败。没有执行任何操作

配置测试的输出是:

apache2: Syntax error on line 216 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf-enabled/nagios3.conf: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
dpkg: error processing package openstack-dashboard-ubuntu-theme (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 openstack-dashboard-ubuntu-theme
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

对于第一个错误:配置测试的输出是:

apache2: Syntax error on line 216 of /etc/apache2/apache2.conf: 
Could not open configuration file /etc/apache2/conf-enabled/nagios3.conf: No such file or directory Action 'configtest' failed.

我的答案:

我使用重新配置了 resolv.conf 文件vi /etc/resolv.conf并设置了 dns ip,以便系统现在能够解析主机,现在系统没有显示错误。

答案2

看起来您已经安装了 nagios,然后启用了 nagios Web 界面,然后卸载了 nagios?这导致了悬空符号链接/etc/apache2/conf-enabled/nagios3.conf。您应该能够使用 ls 命令确认它是否悬空。

如果确实是悬空的,那么只需rm /etc/apache2/conf-enabled/nagios3.conf这样,apache 就可以正常工作了。为了以防万一,请检查 中是否还有其他悬空符号链接/etc/apache2/conf-enabled/

相关内容