PDA

View Full Version : adding to apache path envionmental variable?


mwhybark
04-17-2002, 06:24 PM
at boot, my apache install reports vanilla system paths based on the information available in /etc/rc.common (which is run by system/library/startupitems/apache).

While I could add to the path statemet found there, I'm wary of doing so for security reasons and out of fear of Apple's default installer behavior, which can't be predicted in regard to areas such as /etc/.

Additionally, if I stop and start Apache from the System Preference/Sharing panel, the reported path environment changes to reflect a Users-style userid, with a home folder, and so forth.

I'm trying to grant path access to the contents of the fink /sw/ directory hierarchy so that I can use ImageMagick with the perl-based Movable Type.

Any hints? How does Apache establis or reject path information from the base PATH, the User path, and so forth?

Novajo
04-18-2002, 09:38 AM
I would not touch /sw. /sw if for storing the source code of your software. "Install" the files you want in a /usr/local/xxx directory. Then, you could use the setenv command in httpd.conf, like:

setenv PERL5LIB "/usr/local/site/lib/"

for instance or any other variable for that matter.

mwhybark
04-18-2002, 04:46 PM
actually, usr is one of the directories that Apple can overwrite, so i prefer to install stuff outside of it. /sw/ is the default directory that fink uses, so, again, I prefer to leave it as is.

Happily, all appears to be well.

Here's what was needed.

First of all, setting the appended path variable in rc.common did not improve things, although it did appear in apache's environment.

Second, simply declaring an arbitrary variable in http.conf, although making said variable available in the apache environment, did not resolve the issue.

the appropriate approach was to make the /sw/ perl libs available to the individual scripts by adding the line "use lib /sw/lib/perl5/darwin" to the scripts themselves.

Going a bit deeper, I actually followed the instructions of the honorable Peter N. Lewis seen here:

Peter Lewis' post to mac osx developers perl list (http://archive.develooper.com/macosx%40perl.org/msg01888.html)

in which he gives instructions on altering a couple of lines in "
/sw/fink/dists/stable/main/finkinfo/graphics/imagemagick-5.4.1-3.patch"

once I did that, I ran "fink rebuild imagemagick" and "fink reinstall imagemagick", and things worked fine!

mervTormel
04-18-2002, 06:16 PM
Originally posted by mwhybark
actually, usr is one of the directories that Apple can overwrite, so i prefer to install stuff outside of it....
not /usr/local ; it is reserved for site specific installs.

if apple (or any unix dist'or) were to touch /usr/local they would be regarded at terrorists.

your /usr/local is safe (from apple, anyway).