使用SVN认证的MySQL [英] SVN Authentication using MySQL

查看:467
本文介绍了使用SVN认证的MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过My​​SQL的尝试每库SVN身份验证设置,但我有一些问题。

I'm trying to setup per repository SVN authentication via MySQL but I'm having a few problems.

首先之间有什么区别的 mod_authn_dbd mod_auth_mysql

Firstly what is the difference between mod_authn_dbd and mod_auth_mysql?

其次我已经有一个MySQL数据库设置为用户,组和权限的表。是否有可能使用这MODS的链接进入的地方通过用户名,密码和权限(与读权限preferable和写入每个库的权限)来访问存储库需要我目前的许可制度

Secondly I already have a MySQL database setup with a table for users, groups and permissions. Is it possible using either of these mods to link into my current permission system where by a username, password and permission is required to access the repository (Preferable with a read permission and write permission per repository)

tbl_users:USER_ID,USER_NAME,user_hash

tbl_users: user_id, user_name, user_hash

tbl_group:GROUP_ID,组名

tbl_group: group_id, group_name

tbl_permission:permission_id,PERMISSION_NAME

tbl_permission: permission_id, permission_name

tbl_user_group:USER_ID,GROUP_ID

tbl_user_group: user_id, group_id

tbl_group_permission:GROUP_ID,permission_id

tbl_group_permission: group_id, permission_id

tbl_user_permission:USER_ID,permission_id

tbl_user_permission: user_id, permission_id

推荐答案

首先的差异。

mod_authn_dbd 提供身份验证的前端,如mod_auth_digest的和mod_auth_basic到在SQL表中查找用户进行身份验证的用户。

mod_authn_dbd provides authentication front-ends such as mod_auth_digest and mod_auth_basic to authenticate users by looking up users in SQL tables.

mod_auth_mysql 是一个Apache模块,允许认证使用存储在MySQL数据库用户和组数据。该项目似乎从2005年开始没有更新,所以我会去 mod_authn_dbd

mod_auth_mysql is an Apache module that allows authentication using user and group data stored in MySQL databases. The project seems to not have updated since 2005, so I'd go for mod_authn_dbd.

要正确设置这件事,首先需要配置mod_authn_dbd和Apache配置正确mod_dbd起来,mod_dbd需要你的数据库连接的照顾。一旦你这样做(确保你的Apache与活跃的模块运行),那么你就可以继续进行配置。

To set this up properly, first you need to configure mod_authn_dbd and mod_dbd up properly in your apache configuration, mod_dbd takes care of your database connection. Once you've done this (make sure your Apache is running with those modules active), then you can go ahead configuring them.

添加像这样到Apache的配置,以配置数据库连接:

Add something like this to your apache configuration to configure the database connection:

<IfModule mod_dbd.c>
  DBDriver mysql
  DBDParams "host=(your_db_server, p.e. 127.0.0.1) dbname=your_db_name user=your_db_user pass=your_db_pass"
  DBDMin 1
  DBDKeep 8
  DBDMax 20
  DBDExptime 200
</IfModule> 

现在添加所需的身份验证配置到Apache的配置:

Now add your desired authentication configuration into the apache configuration:

<Directory "/your/svn/repository/path/">
  Options FollowSymLinks Indexes MultiViews
  AuthType Basic
  AuthName "Allowed users Only"
  AuthBasicProvider dbd
  AuthDBDUserPWQuery "SELECT pwd FROM tbl_users, tbl_user_group WHERE tbl_users.user_id=%s AND tbl_user.user_id=tbl_user_group.user_id"
  Require valid-user
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

我已经简化在SELECT语句为更好的可读性,你必须要扩大这个让您的配置完善。

I've simplified the SELECT-statement for better readability, you have to expand this to get your configuration refined.

编辑:

键入我发现在网上一个很好的例子之后,也许读<一个href=\"http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Apache/A_3270-Enabling-and-Administering-Apache%27s-HTTPD-authn-dbd-MySQL-authentication-through-PHP-on-Suse.html\"相对=nofollow>此处了。它去了很多比我的回答简单更深。

After typing I've found a very good example in the web, maybe read it here, too. It goes alot deeper than my simplified answer.

这篇关于使用SVN认证的MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆