Re: How Do You Protect Individual Files

From: Date: Thu, 22 Aug 2002 03:20:59 +0000
Subject: Re: How Do You Protect Individual Files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113579@lists.php.net to get a copy of this message
on 22/08/02 1:10 PM, Roger Lewis (re.lewis@attbi.com) wrote: > Justin, > > Thanks again. I've been doing some more research on .htaccess. The problem > I see is that it is high maintenance, i.e. I've already got a MySQL table of > users with username and password. To use .htaccess, you have to have a > htpasswd file containing duplicate usernames and passwords, and this would > have to be in sync with the MySQL table. NO. All the .htaccess file would do in this case is prevent the files from being served over http AT ALL. Instead, the files are served THROUGH a PHP script which checks for authenticated user first. > I have found that there is an Apache module, mod_auth_mysql, that allows > .htaccess to access a MySQL database for the information it needs. This > module is available at > http://www.diegonet.com/support/mod_auth_mysql.shtml. Problem > is you have > to install the mod and recompile Apache, I think. And I don't know how to > do that yet. However, if everything works in accordance with my > interpretation, you should be able to put an .htascess file into the > directory you wish to protect and Mod_auth_mysql will communicate with the > database to authenticate the users. You don't need anything more that a standard Apache, PHP and MySQL install. Read my last email again, and again, and again. It (hopefully) clearly sets out what you need, and how each part interacts. I don't know how to be much clearer, without doing it for you (which I can do, at a cost :)) Justin French

« previous php.general (#113579) next »