2012-02-25 66 views
1

我正在使用Snow Leopard和Apache 2.2。我想在虛擬主機日誌設置中使用APACHE_ERROR_LOG如何在Mac OS X上爲apache設置env變量

不知怎的,我的錯誤日誌設置變得前綴usr/$。我猜測它一定是在一些現在我無法弄清楚的情況下。

我得到錯誤的Apache日誌爲:

[error] (2)No such file or directory: could not open transfer log file /usr/$PATH_SPECIFIED_FOR_VIRTUAL_HOST_LOGS 
+1

您可能能夠使用此問題的答案(關於PATH環境變量):http://stackoverflow.com/questions/6833939/path-environment-variable-for-apache2-on-mac/6834024#6834024 – Monolo 2012-02-25 17:36:53

+0

沒有解決不了問題。這個問題我不能從/ usr/$獲得的附加位置確定。 此外,我試着發射ErrorLog completelly只是爲了前進沒有日誌設置我得到 您沒有權限訪問/在此服務器上。 403錯誤。 這裏有什麼問題?和日誌有什麼問題 – Ashish 2012-02-26 16:46:11

回答

0

這裏是發生了什麼事。在虛擬主機中,我有一個錯字,它以#開頭。所述的http.conf具有服務器根目錄配置,其說

# 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. 
0

在MAC OS永久地設置的環境變量的最簡單的方法:

打開終端應用:

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

在最近開textedit窗口在文件底部添加給定的環境變量,例如:

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

注意:請確保您使用:(「)而不是(」)