![无法重新加载 Apache,因为配置测试失败,正在查找不再存在的主机文件](https://linux22.com/image/923174/%E6%97%A0%E6%B3%95%E9%87%8D%E6%96%B0%E5%8A%A0%E8%BD%BD%20Apache%EF%BC%8C%E5%9B%A0%E4%B8%BA%E9%85%8D%E7%BD%AE%E6%B5%8B%E8%AF%95%E5%A4%B1%E8%B4%A5%EF%BC%8C%E6%AD%A3%E5%9C%A8%E6%9F%A5%E6%89%BE%E4%B8%8D%E5%86%8D%E5%AD%98%E5%9C%A8%E7%9A%84%E4%B8%BB%E6%9C%BA%E6%96%87%E4%BB%B6.png)
我的服务器上曾经有 700 个虚拟主机。其中一半处于非活动状态,因此我决定通过删除其.conf
文件来禁用和移除它们。
现在,当我尝试重新加载 Apache 时,我得到以下信息:
* Reloading web server apache2
*
* The apache2 configtest failed. Not doing anything.
Output of config test was:
[Fri Apr 10 17:25:28.166779 2020] [so:warn] [pid 15373] AH01574: module headers_module is already loaded, skipping
apache2: Syntax error on line 226 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/thepopulardesign.pe-le-ssl.conf: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
当我尝试获取新域名的证书时,我得到了类似的结果:
Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.
[Fri Apr 10 17:30:28.227920 2020] [so:warn] [pid 15779] AH01574: module headers_module is already loaded, skipping
apache2: Syntax error on line 226 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/thepopulardesign.pe-le-ssl.conf: No such file or directory
请注意,thepopulardesign.pe 是我已删除的域名之一。
我能做些什么?
答案1
这听起来像您可能已经从文件夹中删除了主机配置/etc/apache2/sites-available/
,但没有删除指向它们的符号链接/etc/apaches/sites-enabled
。
仔细检查是否仍有指向不存在的虚拟主机的符号链接sites-enabled
,并根据需要删除它们。