You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mike Harding <mv...@ix.netcom.com> on 2001/04/17 06:20:51 UTC

Simple password method?

We are working with some financial folks who would like us to set
passwords when we bring apache up, rather than using a config file.
We tried various permutations of inputting variables in the 'setup.pl'
file and so on - although we could echo the variable, if we input it,
it was not available to the child processes.  If we set the variable
to a string it is always set, however.

Does anyone have a simple method for inputting a string into a
variable which won't keep it in a file?  The string does not need to
change while apache is running.  We could use shared memory, etc but
that seems like overkill.  I'm a bit puzzled by the observed
behavior.

Thanks,

Mike H.


Re: Simple password method?

Posted by Mike Harding <mv...@ix.netcom.com>.
Sorry if this wasn't exactly clear, it's the _database_ password we
are trying to pass in manually.

We did try exactly the following, and it did not work.  This was a bit
suprising and I was wondering why this was the case...

- Mike H.

   Date: Tue, 17 Apr 2001 09:44:48 -0700 (PDT)
   From: Andrew Ho <an...@tellme.com>
   Cc: <mo...@apache.org>
   Content-Type: TEXT/PLAIN; charset=US-ASCII
   X-SpamBouncer: 1.3 (1/18/00)
   X-SBClass: OK

   Hello,

   MH>We are working with some financial folks who would like us to set
   MH>passwords when we bring apache up, rather than using a config file.
   MH>We tried various permutations of inputting variables in the 'setup.pl'
   MH>file and so on - although we could echo the variable, if we input it,
   MH>it was not available to the child processes.  If we set the variable
   MH>to a string it is always set, however.

   The logic of having webserver that needs human intervention to set up, in
   a production environment, is somewhat doubtful. What happens if your
   webserver goes down and needs to be brought up automatically?

   That aside, your question is a bit confusing. Do you mean that, if you do
   this is the startup script:

       $password = 'constant';

   That the children get the value of $password, but when you prompt for the
   password during startup, the children don't?

   If you put the password in a global, it should persist across the children
   as the Perl startup script is run before forking. Perhaps you should try
   fully qualifying the namespace:

       chomp($My_Company_Name::PASSWORD = <STDIN>);

   And then refering to $My_Company_Name::PASSWORD in your scripts.

   Humbly,

   Andrew

   ----------------------------------------------------------------------
   Andrew Ho               http://www.tellme.com/       andrew@tellme.com
   Engineer                   info@tellme.com          Voice 650-930-9062
   Tellme Networks, Inc.       1-800-555-TELL            Fax 650-930-9101
   ----------------------------------------------------------------------


Re: Simple password method?

Posted by Andrew Ho <an...@tellme.com>.
Hello,

MH>We are working with some financial folks who would like us to set
MH>passwords when we bring apache up, rather than using a config file.
MH>We tried various permutations of inputting variables in the 'setup.pl'
MH>file and so on - although we could echo the variable, if we input it,
MH>it was not available to the child processes.  If we set the variable
MH>to a string it is always set, however.

The logic of having webserver that needs human intervention to set up, in
a production environment, is somewhat doubtful. What happens if your
webserver goes down and needs to be brought up automatically?

That aside, your question is a bit confusing. Do you mean that, if you do
this is the startup script:

    $password = 'constant';

That the children get the value of $password, but when you prompt for the
password during startup, the children don't?

If you put the password in a global, it should persist across the children
as the Perl startup script is run before forking. Perhaps you should try
fully qualifying the namespace:

    chomp($My_Company_Name::PASSWORD = <STDIN>);

And then refering to $My_Company_Name::PASSWORD in your scripts.

Humbly,

Andrew

----------------------------------------------------------------------
Andrew Ho               http://www.tellme.com/       andrew@tellme.com
Engineer                   info@tellme.com          Voice 650-930-9062
Tellme Networks, Inc.       1-800-555-TELL            Fax 650-930-9101
----------------------------------------------------------------------