How to make apache2 authenticate against MS SQL 2000 Server
Author: Gatis Špats
Last Edited: 12.01.2007
In a recent project I needed to make apache2 authenticate against MS SQL 200
I did some hacks to make it happen. So to keep history log of what was done this document was made.
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
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.