Original: http://blog.csdn.net/wobuxingfang/article/details/70835414
Reference: http://www.cnblogs.com/zzugyl/p/3688796.html
---------------------------------------------------------------------------
Ubuntu version: 16.04 LTS
1. Install apache2 and SVN server
# sudo apt-get install apache2
# sudo apt-get install subversion
# sudo apt-get install LIBAPACHE2-SVN
1
2
3
Once you have completed the above installation, you will have direct access to the Apache homepage: http://localhost
2. Create Subversion user group and add Apache running user www-data to Subversion user group
# sudo addgroup subversion
# sudo usermod-g subversion-a www-data
1
2
1. Create SVN group and SVN user first:
sudo addgroup svn
sudo useradd svn-g svn-m//Add SVN username,-G and make the group it's in svn,-m simultaneously create the home directory where the SVN user resides
sudo passwd svn//Set SVN user's password//HZSXSVN I set the user svn password
3. Create SVN repository
# sudo mkdir/home/svn
# sudo svnadmin create/home/svn/repos
1
2
You can see all the folders and configuration files for the SVN repository in the/home/svn/repos directory, such as conf, DB, format, hooks, locks, README.txt.
4. Configure SVN
1, edit Authz, passwd
Authz is the configuration of permissions, passwd is to save the user name password, in order to manage the convenience, put these two files under/HOME/SVN for unified management.
Edit passwd File:
[Users]
admin = Admin
1
2
3
Edit Authz File:
[Groups]
Admin_group = Admin
[/]
@admin_group = RW
1
2
3
4
5
6
Then edit the svnserve.conf file under Repos
# sudo gedit/home/svn/repos/svnserve.conf
1
Anonymous user not readable
Anon-access = None
Rights users can write
auth-access = Write
Password file is passwd
Password-db =.. /.. /passwd
Permission file is Authz
Authz-db =.. /.. /authz
This refers to a relative path, not an absolute path.
5. Start SVN service
# sudo svnserve-d-r/home/svn
1
Description Description:
-d means svnserver runs in daemon process mode
-r Specifies the root location of the file system (the repository's root directory) so that the client can access the repository without entering the full path
such as: Svn://localhost/repos
The SVN installation is now complete.
6. Next is to configure SVN to be accessed via HTTP web in Apache
Before I see some people on the Internet to configure the SVN information in the apache2.conf, there are also some configuration in the Mods-available folder under the dav_svn.conf file, I was configured under the apache2.conf, the configuration content is as follows:
<Location/svn>
DAV SVN
Svnparentpath/home/svn
Svnadvertisev2protocol OFF
AuthType Basic
AuthName "Subversion Repository"
Authuserfile/home/svn/pwdfile
Authzsvnaccessfile/home/svn/authz
Require Valid-user
</Location>
1
2
3
4
5
6
7
8
9
10
Svnpath is the project library address, and if there is only one project library, you can use Svnpath directly. For long-term consideration, decide to use Svnparentpath to put the new project library under/home/svn/. AuthUserFile is to store user files. Authzsvnaccessfile is a user/group permissions file. Require Valid-user is login svn to do validation. Note: This profile is to tell Apache about SVN's access path already associated with the configuration file, here note the root directory of the store.
Add user name password to Pwdfile
# sudo htpasswd-c/home/svn/pwdfile admin
1
Restart the Apache server, sudo/etc/init.d/apache2 restart, and then remote access via Http://localhost/svn/repos.
The first time in Ubuntu build svn, Leng East Nong, get a few days, on-line too many versions, but finally finished, record a bit in case later forget.
Ubuntu builds SVN server with HTTP access