guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile-1.7, apache-1.13.22 and nobody:nogroup user env?


From: rm
Subject: Re: guile-1.7, apache-1.13.22 and nobody:nogroup user env?
Date: Tue, 11 Dec 2001 12:50:51 +0100
User-agent: Mutt/1.0.1i

On Tue, Dec 11, 2001 at 10:33:52AM +0100, David Pirotte wrote:
> Hello,
> 
> sorry to ask this in this list, but I am not sure it is an apache only
> problem, so thanks for your help and/or understanding. In fact, I use
> guile to create dynamically html pages since a long time, and for obscure
> reason to me, it does not work as expected anymore:
> 
>         - using apache 1.3.22
>         - writing scripts using guile 1.7
>       - SuSE 7.2
> 
>         - my httpd.conf contains (notably):
>                 User nobody
>                 Group nogroup
> 
> 'my' nobody user HAS both a '.profile' and a '.bashrc' file that contains all 
> the
> necessary environment variables so that the guile script can execute itself.
> [I added this recently, it was not necessary with previous version of guile, 
> the /etc/ld.so.conf was sufficient (the apache httpd is still the same I only
F
> changed guile)]
> 
> in addition, the /etc/ld.so.conf does also contain all library path that all 
> users
> usually need, and certainly /usr/local/lib where 'libpostgres.so' can be 
> found.
> 
> INDEED, when login as nobody (through root and using "su - nobody", asking the
> script to execute itself, DOES produce the expected results (in a shell)
> 
> HOWEVER, when the script is executed upon user request through the use of a 
> browser,
> I get the following error in the apache error_log file:
> 
>         ERROR: In procedure dynamic-link:
>         ERROR: file: "libpostgres", message: "file not found"
> 
> this is because it does not inherit all nobody user environment variables, 
> but I
> don't know why? the script (see below), tries to load the postgres database 
> module,
> which can only be done if LD_LIBRARY_PATH, PGLIB and PGDATA are defined.
> 
> Anybody can help me?
> Thanks
> David

Well, as far as i recall Apache won't source the login scripts for user
'nobody' UNLESS you start it up as this user (which might be hard given
the fact that you probably want to bind to port 80 ...).
There are several solutuions to this problem: 

 - add the proper environment variables to the script that starts
   your server (usually somewhere in /etc/init.d or the like).

 - there is an Apache module that allows you to set/pass an
   environment variable to a cript (it's called 'mod_env).
   You would add something like:

   SetEnv  LD_LIBRARY_PATH  /usr/local/lib
   SetEnv  PGLIB /whereever/it/is
   SetEnv  PGDATA /same/here
 
   to your Apache configuration.


 Hope this helps 

   Ralf Mattes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]