SVN installation and configuration of Linux under the detailed __linux

Source: Internet
Author: User
Tags install openssl mkdir openssl svn xml parser
First, the preface
The SVN server has two modes of operation: 1. Standalone server; 2. with Apache;
Each has its pros and cons, independent SVN server is not combined with Apache installation, connect the independent SVN server does not use the HTTP protocol.
This is a quicker way to configure the SVN server. This installation uses a standalone server approach.
SVN stores version data in 2 different ways: 1.bdb;2.fsfs.
Because the BDB method may lock the data when the server is interrupted, it is safer to fsfs the way.

two, svn software download
Http://subversion.tigris.org/downloads/subversion-1.6.13.tar.gz
Http://subversion.tigris.org/downloads/subversion-deps-1.6.13.tar.gz

Three, unpack two packages
TAR-XZVF subversion-1.6.17.tar.gz
TAR-XZVF subversion-deps-1.6.17.tar.gz

Iv. Compiling and installing

sudo is the Linux system Management Directive, a tool that allows system administrators to allow ordinary users to perform some or all of the root commands.

1, configuration sudo./configure--prefix=/usr/local/svn--without-berkeley-db
The./configure command is the script named configure that executes the current directory, primarily to configure the software that is about to be installed, to check whether the current environment meets the dependencies of the software to be installed
prefix specifies the installed directory, WITHOUT-BERKELEY-DB indicates that the Berkeley database is not used
If SSL support is required, you will need to install OpenSSL first
In this step may not be successful, because there are some dependent software is not installed, specifically see below " 10, problems encountered"Chapter

2, compile sudo make
The basic use of make is to automatically compile the source files according to the instructions in makefile.

3, installation sudo make install
Make install: Installs the program into the system. If the original code compiles correctly and the results are correct, the program can be installed to the system preset executable file storage path. Default/usr/local/bin

Five. See if the installation is successful
/usr/local/svn/bin/svnserve--version
If the SVN version shows up, the installation is successful.

vi. Adding environment variables
Can be added in/etc/profile, which is global.
Exprot path= $PATH:/usr/local/svn/bin

Make the modified configuration in/etc/profile effective immediately
Source/etc/profile

Seven, configure SVN

1, the establishment of SVN root directory

mkdir-p/opt/svndata/

2, establish a product warehouse mkdir-p/opt/svndata/rps/
Svnadmin create/opt/svndata/rps/

Svnadmin can build multiple SVN warehouse 3, modify version configuration library files
vi/opt/svndata/rps/conf/svnserve.conf
Open this configuration file, you can see a lot of configuration items have been commented out, just need to remove these comments and configure the following
[General]
Anon-access = None
auth-access = Write
Password-db = passwd
Authz-db=authz
4, the authority control file Authz
Vi/opt/svndata/rps/conf/authz
The default is not configured and can be configured by reference to the following example
[Groups]
admin = RPS
[rps:/]
@admin = RW

RPS = RW

The configuration permission control files above are configured in the following format: [groups]
< user group name > = < user 1>,< user 2>
[< Version Library >:/project/directory]
@< user Group Name > = < permissions >
< user name > = < permissions >
The part of the box number can be configured according to the requirements of the project:
/, representing the root directory and below. The root directory is specified when the Svnserve is started, and we specify/opt/svndata. This way,/means to set permissions on all versions of the library.
rps1:/, to set permissions on version library 1
RPS2:/A, to set permissions on the A item in version Library 2
RPS2:/A/AA, which sets the permissions on the AA directory for item A in version library 2
A permission principal can be a user group, user, or *, and the user group adds @,* to the front to represent all users. Permissions can be W, R, WR, and NULL, and NULL means no permissions.

5, modify the user password file passwd
vi/opt/svndata/rps/conf/passwd
The default is not configured with any users, you can configure the sample configuration as follows
[Users]
RPS = 123456
Configuration format for user passwords:
[Users]
< user 1> = < password 1>
< user 2> = < password 2>
Note: The configuration file here, in addition to the comment on each line must be top row, otherwise it will be an error.

Eight, start and stop svn
1,svnserve-d-r/opt/svndata
-D is run in the background,---R means to take the/opt/svndata directory as the root, that is, to have all the warehouse root entries in effect
Note: This is/opt/svndata, not/opt/svndata/rps. This is the command that SVN makes for all warehouse root directories, not a warehouse. It must be noted here.

Way one: svnserve-d-r/opt/svndata/#默认的启动端口号为3690
Mode two: svnserve-d-listen-port 9999-r/opt/svndata/

2, check whether to start
NETSTAT-TUNLP | grep svn
If the following information is displayed indicating successful start
TCP 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 6116/svnserve

3. Add SVN to boot
Edit Rc.local File:vi/etc/rc.d/rc.local
Add the following start command:
/usr/local/svn/bin/svnserve-d-r/opt/svndata

4, if you want to stop SVN, you can use the following command:
Killall Svnserve

Nine, SVN force users to fill in the log information

1, into the/opt/svn/rps/hooks directory, in the SVN version of the library under the Hooks folder, copy template Pre-commit.tmpl, and grant permissions
CP Pre-commit.tmpl Pre-commit
chmod +x Pre-commit

2. Edit Pre-commit File:
Will:
$SVNLOOK log-t "$TXN" "$REPOS" | \
grep "[a-za-z0-9]" >/dev/null | | Exit 1
commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg | | Exit 1
These lines are commented out (front plus # symbol)
3, add the following lines:
Svnlook=/usr/local/svn/bin/svnlook

logmsg= ' $SVNLOOK log-t "$TXN" "$REPOS" | grep "[A-za-z0-9]" | Wc-c '
If ["$LOGMSG"-lt 10];
Then
Echo-e "\nempty log not allowed. Commit aborted! " 1>&2
Exit 1
Fi
Exit 0

10. Problems encountered
1, OpenSSL
Configure when you configure SVN, you may be prompted with the following error message:
Configure:error:We require OpenSSL; Try--with-openssl

Error prompts to install OpenSSL, download openssl:http://www.openssl.org/source/openssl-1.0.1e.tar.gz

Tar zxvf openssl-1.0.1e.tar.gz
CD openssl-1.0.1e
./config--prefix=/usr/local/ssl
Make
make instal


After installation, an SSL directory is generated under/usr/local, and the OpenSSL path is added to the SVN configuration
./configure--prefix=/usr/local/svn--without-berkeley-db--with-openssl=/usr/local/ssl

2. Zlib

Configure when you configure SVN, you may be prompted with the following error message:
Configure:error:subversion requires zlib

Error prompts to install zlib, download zlb:http://zlib.net/

Tar-xvzf zlib-1.2.8.tar.gz
CD zlib-1.2.8
./configure
Make
Make install

3. Expat

Configure when you configure SVN, you may be prompted with the following error message:
Configure:error:no XML Parser was found:expat or libxml 2.x required
Error prompts to install expat, download expat:http://sourceforge.net/projects/expat/files/expat/

Tar zxvf expat-2.1.0.tar.gz
CD expat-2.1.0
./configure
Make

Make Install



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.