Re: Protecting database passwords
| From: | Peter Brodersen | Date: | Thu, 01 Jul 2004 20:43:02 +0000 |
| Subject: | Re: Protecting database passwords | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189491@lists.php.net to get a copy of this message | ||
On Thu, 01 Jul 2004 06:55:38 -0700, zeus@ix.netcom.com (Bob Hockney)
wrote:
>What I am concerned about is a local user on the server machine, not access through
>the web server. It sounds like it can be done if there is a separate user or group for the
>web server process, but this site specific. It would be difficult to distribute a program
>and use a generalized install routine to install the file containing the passwords to be
>edited by the site admin.
You could move the virtual host to its own file, only readable by root
(and include this virtual host-file in httpd.conf).
Use SetEnv in this virtual host to set values like DBUSER, DBPASS and
so on:
http://httpd.apache.org/docs/mod/mod_env.html#setenv
You can choose whatever names you like.
The PHP script would then just have to read these environment values
to retrieve username and password.