Fix “No such file or directory: httpd: could not open error log file /…/${APACHE_LOG_DIR}/site.log”

If you get an error like this in the Apache2 error log:

No such file or directory: httpd: could not open error log file /.../${APACHE_LOG_DIR}/site.log

apache_logo

You can fix it by just adding the path of your Apache2 log folder in the envvars file. If you use Mac Ports it’s located in /opt/local/apache2/bin/envvars:

export APACHE_LOG_DIR=/opt/local/apache2/logs

If you don’t know where envvars is just find it with this command:

find / -name "envvars"

Once added just restart the Apache2 server.

You might also like

Password protect a Location, LocationMatch or VirtualHost in Apache (XAMPP and Mac OS X)
Protecting a Location or VirtualHost in Apache is very similar to protecting a folder as I explained...

Fix locale problems in Raspbian
If you get errors like this while running commands on your Raspbian:perl: warning: Setting locale...

Enable hosting files outside /var/www in Apache2
I'm using Ubuntu and Mac OS X in my computer. I wanted both to share a partition to put all the things...

Apache 2 + MySQL 5 + PHP 5.3 + phpMyAdmin 3.5.4 installation script for Mac OS X using MacPorts
Based on the instructions provided by Gilles Fabio I've created a complete installation script to install...

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.