Tag Archives: APACHE_LOG_DIR

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

Or in /opt/local/sbin/envvars:

export APACHE_LOG_DIR=/opt/local/var/log/apache2

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

find / -name "envvars"

Once added just restart the Apache2 server.