SVN-based MySQL authentication

Source: Internet
Author: User


Introduction to SVN and how it works

Subversion (SVN) is a version management software that has risen in recent years and is the successor to CVS, and most open source software uses SVN as the code version management software. Subversion supports Linux and Windows, but common applications are on Linux.

SVN works mainly in two ways: by using a standalone server and relying on the Apache way of working.

SVN's role is reflected in the following areas

1, solve the problem of code management disorder.

2. Solve the problem of code conflict.

3, to solve the code owner of code permissions control.

4 、.......


The following example mainly explains the SVN MySQL-based authentication.

System environment: centos6.5 Server ip:172.18.107.176


First, install the relevant data package

#yum-y install mysql mysql-devel mysql-server httpd mod_auth_mysql Subversion mod_dav_svn

Second, start the related services.

#service mysqld start#service httpd start

Third, create projects and related authorizations

#mkdir-P/data/svn/#svnadmin create/data/svn/test #创建一个名为test的项目 #vim/data/svn/authz #创建SVN                       Authentication file [groups]admin = eelly01,eelly02,test100 #添加SVN用户名 [test:/] #对test版本库进行权限设置 @admin = RW #允许admin这个组的成员对这个版本库有读写的权限

Grant the project Apache permissions, otherwise it cannot be accessed via HTTP.

#chown-R apache.apache/data/svn/#chmod 755/data/svn/-R

V. Create an authentication database

#mysql-uroot-p 1) Create database mysql>create Svn_auth;mysql>use svn_auth;mysql>grant all privileges on * * to [E Mail protected] '% ' identified by ' 123456 ' with GRANT option; 2) CREATE table mysql> the CREATE table users (user_name char () not null,user_passwd char (a) not null,primary KEY (user_name)); 3) Create a test account mysql> insert into svn_auth.users values (' test100 ', Encrypt (' 123456 '));mysql> insert INTO Svn_auth.users VALUES (' Eelly01 ', Encrypt (' 123456 '));mysql> insert into svn_auth.users values (' eelly02 ', Encrypt (' 123456 '));


VI, Apache and SVN integrated  

#vim  /etc/httpd/conf/httpd.conf           #添加如下内容    <location /svn>    dav svn    svnparentpath  /data/svn/              #项目的父目录      AuthzSVNAccessFile /data/svn/authz    #svn访问认证文件      authname  "Eelly subversion"            #认证名称      AuthType Basic                         #基本认证     authmysqlenable  on                     #开启mysql认证     AuthMYSQLUser svn                      #数据库访问用户名         authmysqlpassword 123456             # Password for database access     AuthMYSQLDB svn_auth                   #存放认证信息的数据库名称     authmysqlusertable  users              #存放认证信息的表名称       AuthMYSQLNameField user_name           #存放认证用户名的字段名称     authmysqlpasswordfield user_passwd   # Name of the field that holds the authentication password     Require valid-user  </Location>

Seven, restart Apache server .

# service httpd Restart stop httpd: [OK] is starting httpd: Determine

Eight, test. visit http://172.18.107.176/svn/test

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/49/CC/wKioL1Qam8eQlpkVAADjgevhrFs733.jpg "title=" 1.png " alt= "Wkiol1qam8eqlpkvaadjgevhrfs733.jpg"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/49/CA/wKiom1Qam8fhezQ4AADc8lHFRTQ730.jpg "title=" 2.png " alt= "Wkiom1qam8fhezq4aadc8lhfrtq730.jpg"/>


From the above see in the database created test100 this user can log in. Eelly01 is not a problem. Such as. (Of course there is nothing in it, because it is a new version of the repository)


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/49/CA/wKiom1QanIrTleI-AAHBq_SNyFE049.jpg "title=" 3.png " alt= "Wkiom1qanirtlei-aahbq_snyfe049.jpg"/>


Simple SVN-based MySQL authentication is done, just need to create a user in the MySQL database, and then in the Authz file to give users the appropriate permissions to access the corresponding repository.

This article is from the "operations, hello" blog, please be sure to keep this source http://denghaibin.blog.51cto.com/4128215/1554829

SVN-based MySQL authentication

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.