Debian8 apache2.4.x deploy mysql-authorized subversion
Recently, you need to migrate an old server with the mysql-authorized subverison application under apache2.2. Then we made a research.
In the past, apache2 configuration was unavailable, mainly because the modules used for mysql authentication in apache2.4.x and apache2.2.x were greatly changed. In the past, it was the auth_mysql module. This module has expired in apache2.4.x and needs to be replaced by the authn_dbd and authz_dbd modules. The corresponding configuration also needs to be modified.
The settings are described below.
Environment: debian8u2. All packages are installed using apt-get.
-------------------------------------------------------------
Install the required software package. Note that this article does not involve the setup of the mysql service and considers that the mysql service has been set up (either local or other server hosts ).
- apt-get install apache2 libapache2-mod-svn mysql-client libaprutil1-dbd-mysql
Set the related modules of apache2 load (note that some modules have been automatically loaded when installing the libapache2-mod-svn, otherwise you need to add dav_svn.load and dav_svn.conf), the following modules are mainly using the database for authentication.
- a2enmod auth*_dbd dbd
Modify a host configuration of apache2 to complete subversion authentication access.
The following is an example.
-
- ...
- # Basic database access configuration
- # Database mode
- DBDriver mysql
- # Database access connection information, which should be configured according to the actual situation. The host is the database service host, the port corresponds to the Service port, the dbname corresponds to the database to be accessed, and the user is the access user name, pass is the access password (the password is in plaintext)
- DBDParams "host = 192.168.1.150 port = 3306 dbname = svnauth user = authuser pass = dbpasswd"
- DBDMin 4
- DBDKeep 8
- DBDMax 20
- DBDExptime 300
- # Configuration of a subversion Project
-
- # Configure the subversion repository to be accessed using DAV
- DAV svn
- # Place the data in the repository. Note that the FSFS data structure is used.
- SVNPath/var/svnlibs/svnprj
- # A parsing XSLT data definition that is referenced in the browser (relative to the web path)
- SVNIndexXSLT/svnindex. xsl
- SVNAutoversioning on
- AuthName "Svnprj MySql"
- AuthType Basic
- # The authentication method is dbd, that is, database
- AuthBasicProvider dbd
- Require valid-user
- # Modify the user query statement according to the actual situation. The table name is users, the username field is user_name, and the user password field is user_passwd.
- AuthDBDUserPWQuery "SELECT user_passwd FROM users WHERE user_name = % s"
- # Enable Read Permission for Authenticated Users
-
- # User group permission Configuration
- # Database query for user groups
- Require dbd-group work
- # Modify the user group query statement according to the actual situation. The table name is groups, the username field is user_name, and the user group field is user_group.
- AuthzDBDQuery "SELECT user_group FROM groups WHERE user_name = % s"
-
- # Permission configuration for individual users
- Require user auser
-
- Require valid-user
- ...
So far, the configuration of an apache2.4 that supports mysql authentication is complete after it is integrated with the subversion repository service. This is the configuration of a repository. to configure multiple repositories, you only need
- SVNPath /var/svnlibs/svnprj
Change
- # Specify the parent directory of multiple warehouses
- SVNParentPath/var/svnlibs
- SVNListParentPath on
You can.