我遇到了一些Apache Web服务器错误日志的问题.
我的计算机上有一个虚拟托管的网站scotthermmann.loc.手动清除错误日志后,使用
sudo cat /dev/null > scotthermmann.loc-error_log
或者在emacs&中打开文件删除所有内容,错误不再记录到文件中.我试过用了
sudo apachectl restart
解决问题,但它没有解决它.退出&回来也没有解决它.解决它的原因是重新启动计算机,但每次清除错误日志后我都不想这样做.
我所托管的每个网站都不是这种情况.我有另一个网站barefootfool.loc.在我清除错误日志后,我没有任何问题.
两个虚拟站点在httpd-vhosts.conf文件中具有基本相同的设置.对于scottherrmann.loc:
<VirtualHost *:80>
DocumentRoot "/Users/dan/Sites/scottherrmann.com"
??? ServerName scottherrmann.loc
??? ServerAlias www.scottherrmann.loc
??? ErrorLog "/private/var/log/apache2/scottherrmann.loc-error_log"
??? CustomLog "/private/var/log/apache2/scottherrmann.loc-access_log"
<Directory "/Users/dan/Sites/scottherrmann.com">
??? Options Indexes FollowSymLinks
??????? AllowOverride All
??????? Order Allow,Deny
??????? Allow from all
</Directory>
</VirtualHost>
对于barefootfool.loc:
<VirtualHost *:80>
DocumentRoot "/Users/dan/Sites/barefootfool.com"
ServerName barefootfool.loc
ServerAlias www.barefootfool.loc
ErrorLog "/private/var/log/apache2/barefootfool.loc-error_log"
CustomLog "/private/var/log/apache2/barefootfool.loc-access_log"
<Directory "/Users/dan/Sites/barefootfool.com">
??? Options Indexes FollowSymLinks
??????? AllowOverride All
??????? Order Allow,Deny
????? Allow from all
</Directory>
</VirtualHost>
有谁知道可能导致问题的原因是什么?
解决方法:
我只是因为我不小心删除了/ var / log / httpd / error_log文件,然后触及了一个新的日志文件.
service httpd restart
解决了这个问题.下次我将截断error_log
:>error_log
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!