7

我正在使用 Ubuntu 14.04 和 apache2 和 ispconfig 3。就在几个小时前,我不小心删除了 /var/log/apache2 文件夹包含文件,现在我的服务器无法重新启动 apache2,我该如何恢复它们?还是该日志文件夹和文件将在重新启动服务器时由系统自动创建?

当我重新启动 apache2

 * Restarting web server apache2                                         [fail]
 * The apache2 configtest failed.
Output of config test was:
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:61
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log
(2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for error log of vhost defined at /etc/apache2/sites-enabled/000-default.conf:1
AH00014: Configuration check failed
Action 'configtest' failed.
The Apache error log may have more information.
4

2 回答 2

20

固定的!

sudo mkdir /var/log/apache2/
sudo touch /var/log/apache2/{access,error,other_vhosts_access,suexec}.log
sudo chown -R root:adm /var/log/apache2/
sudo chmod -R 750 /var/log/apache2
于 2016-06-13T19:18:35.993 回答
1

无需更改。我只添加tmpfs /var/log/apache2 tmpfs defaults,noatime 0 0/etc/fstab. 然后重启电脑。并在我的 Ubuntu 16.04 上修复它。

于 2016-06-23T07:24:12.987 回答