意外删除了/var/log/apache2,现在无法重新启动apache [英] Accidentally deleted /var/log/apache2 and now can't restart apache

查看:283
本文介绍了意外删除了/var/log/apache2,现在无法重新启动apache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using Ubuntu 14.04 and apache2 and ispconfig 3. Just a few hours ago I accidentally deleted /var/log/apache2 folder include files, now my server can't restart apache2, how can I restore them? or is that log folder and file will auto create by system, when reboot server?

当我重新启动apache2

When I restart 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.

推荐答案

已修复!

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

这篇关于意外删除了/var/log/apache2,现在无法重新启动apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆