How to make apache2 authenticate against MS SQL 2000 Server

Want to support HowtoForge? Become a subscriber!
 
Submitted by spats (Contact Author) (Forums) on Mon, 2007-01-15 17:15. :: Apache

How to make apache2 authenticate against MS SQL 2000 Server

Author: Gatis Špats
www: http://dainuskapis.blogspot.com
Last Edited: 12.01.2007

1. Intro

In a recent project I needed to make apache2 authenticate against MS SQL 200 Server.
I did some hacks to make it happen. So to keep history log of what was done this document was made.

2. Situation

1. MS SQL database server running on Windows 2003 Server
2. User records (logins and passwords) are kept in MS SQL database (1)
3. SuSe Linux Enterprise server 9 with apache2. Some directories on that server need to have limited access

3. Target

Avoid many passwords. Make apache2 authenticate against MS SQL. If user has the rights to access particular DB - she has right to use the restricted area on our SuSe Linux apache2 web server.

4. Solution design ideas

1. have some program/script to run on Linux machine. Take authentication (username/password) data from user (login form or standard apache authentication window like the one that is used with .htaccess authentication)

2. Pass these credentials to that program/script. So that script tries to make the connection to our MS SQL database. If connection is successful - program/script returns ok message and tells apache that user is allowed to access restricted area.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.