I've had a problem with some Apache web server error logs.
I have a virtually hosted website scotthermmann.loc on my computer. After I manually clear an error log, using
sudo cat /dev/null > scotthermmann.loc-error_log
or by opening the file in emacs & deleting all content, errors no longer get logged to the file. I've tried using
sudo apachectl restart
to solve the problem, but it doesn't solve it. Logging out & back in doesn't solve it either. What does solve it is restarting the computer, but I don't want to do that after every time I clear an error log.
This isn't the case for every website I host. I have another website barefootfool.loc. After I clear that error log, I don't have any problems.
Both virtual sites have essentially the same setup in the httpd-vhosts.conf file. For 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>
And for 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>
Does anyone have an idea what could be causing the problem?
I just had this it was because I inadvisably deleted the /var/log/httpd/error_log file and then touched a new log file.
service httpd restart
cleared the problem . next time I'll truncate the error_log with
:>error_log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With