1

I am using Snow Leopard and Apache 2.2. I want to set APACHE_ERROR_LOG used in virtual host log settings.

Somehow my Errorlog setting is getting prefixed with usr/$. I am guessing it must be in some setting which right now I can't figure out.

I get error in apache log as:

[error] (2)No such file or directory: could not open transfer log file /usr/$PATH_SPECIFIED_FOR_VIRTUAL_HOST_LOGS
Monolo
  • 18,205
  • 17
  • 69
  • 103
Ashish
  • 851
  • 12
  • 27
  • 1
    You might be able to use the answer to this question (about the PATH environment variable): http://stackoverflow.com/questions/6833939/path-environment-variable-for-apache2-on-mac/6834024#6834024 – Monolo Feb 25 '12 at 17:36
  • no that didn't solve the problem . The problem i can't really figure our from where does /usr/$ gets appended. Also then i tried emitting the ErrorLog completelly just to move forward without log setting i get You don't have permission to access / on this server. 403 error. what is wrong here? and whats wrong with the logs – Ashish Feb 26 '12 at 16:46

2 Answers2

1

Here is what was wrong. In one of the virtual host i has typo and it started with #. The http.conf has server-root configuration which says

# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk.  If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "/usr"

It was terrible typo mstake.
Ashish
  • 851
  • 12
  • 27
0

The easiest way to set an environment variable permanently in mac OS:

Open terminal application:

open -a /Applications/TextEdit.app ~/.bash_profile

In the recently open textedit window add at the bottom of the file the given environment variable, for example:

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/"

NOTE: Make sure you use: (") instead of (“)