You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Paolo DiCanio <do...@yahoo.co.uk> on 2011/01/11 09:58:20 UTC

[users@httpd] SQL Server authentication

Hi,

My Apache server currently uses a passwd file for authentication. I need to
change the authentication scheme so that it uses both this passwd file and a
list of usernames and passwords stored in an SQL Server database table. 

In other words, if the username and password is found in the file, or in the
database, then authentication succeeds. Obviously the latter will require me
to configure the database connection parameters, and the SQL query to
execute (with placeholders for username and password).

If it's not possible for Apache to use both a file and a database for
authentication, then if someone could explain how to configure SQL Server
database authentication (only), I'd be very grateful.

Thanks,
Paolo
-- 
View this message in context: http://old.nabble.com/SQL-Server-authentication-tp30641656p30641656.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SQL Server authentication

Posted by Nilesh Govindarajan <ni...@itech7.com>.
On 01/11/2011 02:28 PM, Paolo DiCanio wrote:
> Hi,
>
> My Apache server currently uses a passwd file for authentication. I need to
> change the authentication scheme so that it uses both this passwd file and a
> list of usernames and passwords stored in an SQL Server database table.
>
> In other words, if the username and password is found in the file, or in the
> database, then authentication succeeds. Obviously the latter will require me
> to configure the database connection parameters, and the SQL query to
> execute (with placeholders for username and password).
>
> If it's not possible for Apache to use both a file and a database for
> authentication, then if someone could explain how to configure SQL Server
> database authentication (only), I'd be very grateful.
>
> Thanks,
> Paolo

http://httpd.apache.org/docs/2.2/mod/mod_authn_dbd.html

-- 
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
VPS Hosting: http://www.itech7.com/a/vps


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SQL Server authentication

Posted by Nick Kew <ni...@webthing.com>.
The APR FreeTDS driver may do the job, but it has some
issues: I wouldn't expect great performance from it,
and be sure you read and understand the note on
security - it requires more care than other drivers!

I'm not familiar with the APR ODBC driver.  ApacheLounge
may have more information on it: its original developer
Tom Donovan is one of the leading lights there.  It should
at least be worth a look.

Either way, you may get a performance boost by combining
it with mod_authn_socache to cache credentials and lighten
the load on your database.

-- 
Nick Kew

Available for work, contract or permanent.
http://www.webthing.com/~nick/cv.html

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SQL Server authentication

Posted by "Mark H. Wood" <mw...@IUPUI.Edu>.
On Tue, Jan 11, 2011 at 10:11:25PM +0530, Nilesh Govindarajan wrote:
> On 01/11/2011 09:13 PM, Hendrik Schmieder wrote:
[snip]
> > It depends on which oS Apache is used.
> > For Windows there's an MS-SQL ODBC driver, but for Linux you must use 
> > FreeTDS.
> >
> >
> It doesn't support unixODBC?
> [sorry for hijacking]

UnixODBC is a driver manager.  The package includes *some* drivers.
For SQL Server they direct you to either FreeTDS or a "free trial"
from EasySoft.  The "drivers" page at http://www.unixodbc.org/ has a
lot of links to drivers that *don't come with UnixODBC*.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Asking whether markets are efficient is like asking whether people are smart.

Re: [users@httpd] SQL Server authentication

Posted by Nilesh Govindarajan <ni...@itech7.com>.
On 01/11/2011 09:13 PM, Hendrik Schmieder wrote:
> Mark H. Wood schrieb:
>> On Tue, Jan 11, 2011 at 06:06:16PM +0530, Nilesh Govindarajan wrote:
>>> On 01/11/2011 04:18 PM, Paolo DiCanio wrote:
>>>> The example on that page is for MySql. Unfortunately when using SQL 
>>>> Server,
>>>> the configuration is more complicated, because you can't simply 
>>>> configure
>>>>
>>>>       DBDriver mssql
>>>>
>>>> You have to use something called FreeTDS instead. If someone has 
>>>> actually
>>>> got SQL Server authentication up and running, I'd really appreciate 
>>>> it if
>>>> the could send me the steps, or just post their httpd.conf.
>>>>
>>>> Also, any information about how to configure multiple 
>>>> authentication methods
>>>> (passwd file and database), would be very helpful. If someone can 
>>>> confirm
>>>> whether or not this is even possible, please let me know.
>>>>
>>> APR (mod_dbd, mod_authn_dbd) supports ODBC (provided, 
>>> apr_dbd_odbc.so or
>>> apr_dbd_odbc.dll exists in the system), which is independent of 
>>> FreeTDS.
>>> MSSQL doesn't support ODBC?
>>
>> It does, but my understanding is that ODBC drivers for MSSQL implement
>> ODBC APIs using the TDS protocol.  ODBC is just a common API to talk
>> to various specific drivers, which use various protocols to talk to
>> their proper backends.  According to http://www.freetds.org/ FreeTDS
>> includes an ODBC library, so you'd probably just need to install it,
>> describe it to your driver manager, and tell HTTPD to use it.
>>
>
> It depends on which oS Apache is used.
> For Windows there's an MS-SQL ODBC driver, but for Linux you must use 
> FreeTDS.
>
>
It doesn't support unixODBC?
[sorry for hijacking]

-- 
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
VPS Hosting: http://www.itech7.com/a/vps


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SQL Server authentication

Posted by Hendrik Schmieder <he...@jedox.com>.
Mark H. Wood schrieb:
> On Tue, Jan 11, 2011 at 06:06:16PM +0530, Nilesh Govindarajan wrote:
>> On 01/11/2011 04:18 PM, Paolo DiCanio wrote:
>>> The example on that page is for MySql. Unfortunately when using SQL Server,
>>> the configuration is more complicated, because you can't simply configure
>>>
>>>       DBDriver mssql
>>>
>>> You have to use something called FreeTDS instead. If someone has actually
>>> got SQL Server authentication up and running, I'd really appreciate it if
>>> the could send me the steps, or just post their httpd.conf.
>>>
>>> Also, any information about how to configure multiple authentication methods
>>> (passwd file and database), would be very helpful. If someone can confirm
>>> whether or not this is even possible, please let me know.
>>>
>> APR (mod_dbd, mod_authn_dbd) supports ODBC (provided, apr_dbd_odbc.so or
>> apr_dbd_odbc.dll exists in the system), which is independent of FreeTDS.
>> MSSQL doesn't support ODBC?
>
> It does, but my understanding is that ODBC drivers for MSSQL implement
> ODBC APIs using the TDS protocol.  ODBC is just a common API to talk
> to various specific drivers, which use various protocols to talk to
> their proper backends.  According to http://www.freetds.org/ FreeTDS
> includes an ODBC library, so you'd probably just need to install it,
> describe it to your driver manager, and tell HTTPD to use it.
>

It depends on which oS Apache is used.
For Windows there's an MS-SQL ODBC driver, but for Linux you must use 
FreeTDS.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SQL Server authentication

Posted by "Mark H. Wood" <mw...@IUPUI.Edu>.
On Tue, Jan 11, 2011 at 06:06:16PM +0530, Nilesh Govindarajan wrote:
> On 01/11/2011 04:18 PM, Paolo DiCanio wrote:
> > The example on that page is for MySql. Unfortunately when using SQL Server,
> > the configuration is more complicated, because you can't simply configure
> >
> >      DBDriver mssql
> >
> > You have to use something called FreeTDS instead. If someone has actually
> > got SQL Server authentication up and running, I'd really appreciate it if
> > the could send me the steps, or just post their httpd.conf.
> >
> > Also, any information about how to configure multiple authentication methods
> > (passwd file and database), would be very helpful. If someone can confirm
> > whether or not this is even possible, please let me know.
> >
> APR (mod_dbd, mod_authn_dbd) supports ODBC (provided, apr_dbd_odbc.so or 
> apr_dbd_odbc.dll exists in the system), which is independent of FreeTDS. 
> MSSQL doesn't support ODBC?

It does, but my understanding is that ODBC drivers for MSSQL implement
ODBC APIs using the TDS protocol.  ODBC is just a common API to talk
to various specific drivers, which use various protocols to talk to
their proper backends.  According to http://www.freetds.org/ FreeTDS
includes an ODBC library, so you'd probably just need to install it,
describe it to your driver manager, and tell HTTPD to use it.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Asking whether markets are efficient is like asking whether people are smart.

Re: [users@httpd] SQL Server authentication

Posted by Nilesh Govindarajan <ni...@itech7.com>.
On 01/11/2011 04:18 PM, Paolo DiCanio wrote:
> The example on that page is for MySql. Unfortunately when using SQL Server,
> the configuration is more complicated, because you can't simply configure
>
>      DBDriver mssql
>
> You have to use something called FreeTDS instead. If someone has actually
> got SQL Server authentication up and running, I'd really appreciate it if
> the could send me the steps, or just post their httpd.conf.
>
> Also, any information about how to configure multiple authentication methods
> (passwd file and database), would be very helpful. If someone can confirm
> whether or not this is even possible, please let me know.
>
APR (mod_dbd, mod_authn_dbd) supports ODBC (provided, apr_dbd_odbc.so or 
apr_dbd_odbc.dll exists in the system), which is independent of FreeTDS. 
MSSQL doesn't support ODBC?
As far as I know, you can compile APR separately to support that.

-- 
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
VPS Hosting: http://www.itech7.com/a/vps


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SQL Server authentication

Posted by Paolo DiCanio <do...@yahoo.co.uk>.
The example on that page is for MySql. Unfortunately when using SQL Server,
the configuration is more complicated, because you can't simply configure

    DBDriver mssql

You have to use something called FreeTDS instead. If someone has actually
got SQL Server authentication up and running, I'd really appreciate it if
the could send me the steps, or just post their httpd.conf.

Also, any information about how to configure multiple authentication methods
(passwd file and database), would be very helpful. If someone can confirm
whether or not this is even possible, please let me know.


Devraj Mukherjee-3 wrote:
> 
> I found this looking for a solution to my MySQL authentication post, might
> help.
> http://httpd.apache.org/docs/2.2/mod/mod_authn_dbd.html
> 
> Says that it supports ODBC.
> 

-- 
View this message in context: http://old.nabble.com/SQL-Server-authentication-tp30641656p30642376.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SQL Server authentication

Posted by Devraj Mukherjee <de...@gmail.com>.
Hi Paolo,

I found this looking for a solution to my MySQL authentication post, might help.
http://httpd.apache.org/docs/2.2/mod/mod_authn_dbd.html

Says that it supports ODBC.

Good luck.

On Tue, Jan 11, 2011 at 7:58 PM, Paolo DiCanio <do...@yahoo.co.uk> wrote:
>
> Hi,
>
> My Apache server currently uses a passwd file for authentication. I need to
> change the authentication scheme so that it uses both this passwd file and a
> list of usernames and passwords stored in an SQL Server database table.
>
> In other words, if the username and password is found in the file, or in the
> database, then authentication succeeds. Obviously the latter will require me
> to configure the database connection parameters, and the SQL query to
> execute (with placeholders for username and password).
>
> If it's not possible for Apache to use both a file and a database for
> authentication, then if someone could explain how to configure SQL Server
> database authentication (only), I'd be very grateful.
>
> Thanks,
> Paolo
> --
> View this message in context: http://old.nabble.com/SQL-Server-authentication-tp30641656p30641656.html
> Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org