gpt4 book ai didi

php - 未写入 Apache 错误日志的错误

转载 作者:可可西里 更新时间:2023-11-01 00:45:28 24 4
gpt4 key购买 nike

我遇到了一些 Apache 网络服务器错误日志的问题。

我的计算机上有一个虚拟托管网站 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

关于php - 未写入 Apache 错误日志的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20485105/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com