On Mon, 7 May 2001, Benoit Caron wrote:
> The way I've setup whole thing is like that : a script name restart is
> called with some parameters telling him to reload one or all the
> developpers environment, or the "testing" copy. This script would have some
> environments variables called SITE_USER and SITE_USER_PORT that will give
> me the value (read in a file defining the different users) of the username
> (and by the same way the files path) and the port where the user should work.
>
> My problem is that my envirnoment variables are not set. If I do a
> Dumper(\%ENV), I only got values for the variables TZ, GATEWAY_INTERFACE,
> MOD_PERL and PATH. (I do double-check that my variables where well setup).
You could try PerlPassEnv:
PerlPassEnv SITE_USER
PerlPassEnv SITE_USER_PORT
...but the solution I've used is to have the startup script dynamically
build a configuration based on a configuration "template". In fact, the
script doesn't even live in /etc anywhere -- it's part of the CVS checked
out area that each developer has individually. The config template is just
a standard Apache config file with special @@ tokens in it like the Apache
*.orig files:
ServerRoot @@SERVERROOT@@
Port @@SERVERPORT@@
The script changes these tokens when (re)starting Apache, and runs "apache
-f /tmp/httpd-[user]-[port].conf".
It also takes things a step further in that it automatically calculates a
port number based on the value of the "server root", by running it through
"sum". This way, you don't need to decide on a port for everybody -- they
just check out a copy of the website and start it. If they want to have
another copy of the website, let's say under ~/website-hacking, that's
fine -- it'll decide on a different port automatically.
I can send the startup script and config template if you want to see what
I mean.
> The only way I still see to make it work is having my "restart" script
> saving the current user/port in a file and letting the <perl> section read
> it's configuration from there. But it look so patchy...
Eeeeeyuuckkkk....