Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set up password protected directory on Apache 2?

Status
Not open for further replies.

crash4ever

Programmer
Aug 6, 2001
33
0
0
US
Hi,
I'm new to Apache 2 (RedHat Linux 9) and needs help on this matter. We need to set up specific password protected directories for certain users. For example, all users will see the logon page on
Then based on their user name and password, they will be redirected to their own directories. So for example we have 10 directories; A could only see directory A, etc.

I'm trying to use AuthMySql method but so far I don't know how to redirect user to their own directory. Is there any other better method to accomplish this instead using MySql Auth method?

My auth_mysql.conf (/etc/httpd/conf.d) code:

LoadModule mysql_auth_module modules/mod_auth_mysql.so

<Directory /var/ AuthName &quot;MySQL authenticated zone&quot;
AuthType Basic

AuthMySQLUser user
AuthMySQLPassword password
AuthMySQLDB auth
AuthMySQLUserTable users
AuthMySQLNameField user_name
AuthMySQLPasswordField user_passwd

require valid-user
</Directory>


Thanks,
Vicky
 
What scripting language are you planning to use? It'd be more user-friendly to do your user-authentication with PHP or something similar.

<?legalstuff
The above is my opinion only and should not be construed as the opinion of my employer.
?>
 
Sorry, but JSP is out of my range of expertise. I don't think Tek-tips has a JSP forum either - you might try Devshed though:


<?legalstuff
The above is my opinion only and should not be construed as the opinion of my employer.
?>
 
I have a login page that checks the users id and password and reurns the directory (stored in db) then calls a servlet that determines what directory to show. Its pretty easy just store in your db login, passwd, directory and when the user tries to login verify against your db and then return the directory. After the directory is returned your servlet can forward the user to the specified directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top