SVN installation and configuration under Linux

My installation system is linux centos6.4
Chapter 1 Installation
1. Compile and install using source files. There are two source files:
subversion-1.6.1.tar.gz (subversion source file)
subversion-deps-1.6.1.tar.gz (subversion dependency file)
Note that the file versions must be consistent, otherwise it is easy to produce various Strange problem.

2. Upload the above two files to the server and decompress them. The decompression command is:

1 tar xfvz subversion-1.6.1.tar.gz
2 tar xfvz subversion-deps-1.6.1.tar.gz
Command introduction: tar is the decompression command, xfvz is the parameter of the tar command, which is used to decompress tar. gz format compressed file.

3. After decompression, a subversion-1.6.1 subdirectory will be generated. After decompression, the two compressed packages will be automatically placed in this directory without manual modification.

4. Enter the decompressed subdirectory:

1 cd subversion-1.6.1
5. Execute ./configure –prefix=/opt/subversion to configure settings and specify the installation directory. Note that there are two minus signs before the prefix. By default, no BDB package is included , so the FSFS mode is used by default. If you want to use the BDB mode, you need to download the BDB package separately. It is recommended to use the FSFS mode. For a comparison of the two modes, refer to the following link:

http://doc.iusesvn.com/show-21-1.html

Instruction introduction: The configure command is used to check the installation platform and target characteristics, and the prefix is ​​used to specify the path.

6. Execute make to compile.

7. Execute make install to install.

8. Add environment variables:

1 vi /etc/profile
at the end of the file:
PATH=$PATH:/opt/subversion/bin
export PATH

9. Test whether SVN is successfully installed , Execute:

1 svnserve --version
If the version information is displayed, the installation is successful.

Chapter 2 Configuration

This system adopts the strategy of building a separate version library for each project. Configuration files, password files, access control files, etc. are all placed in the conf directory of the repository. So every time you start a new project, you must create a new repository and reconfigure the configuration files. There is also a very important one, requiring each team member to reconfigure the client, including the server version library path, local path and other information.

1. Create a repository directory (more than one can be created. After creating a new repository, the following items need to be reconfigured. Note the difference between the installation directory and the repository directory. The following are the repository directories)

1 mkdir –p /opt/svndata/ repos
2. Create the svn repository (corresponding to the above directory)

1 svnadmin create /opt/svndata/repos
After executing this command, svn automatically adds the necessary configuration files in the repos directory.
Note: The repository is different from the general folder, directly The newly created file on the operating system cannot be recognized by SVN, and commands such as import must be used to import the file into the repository.
This is an internal command of svn, and create is used to create a new repository. Please use svn help for detailed instructions.


3. Modify the repository configuration file

1 vi /opt/svndata/repos/conf/svnserve.conf
Each parameter function is described in the comments of the configuration file, and the configuration is as follows:
[general]
anon-access = none # Make unauthorized User cannot access
auth-access = write # Make authorized users have write access
password-db = passwd # Specify the password file path
authz-db = authz # Access control file
realm = /opt/svndata/repos # Authentication namespace, subversion will be in Displayed in the authentication prompt and used as a key for the credential cache.
Others use the default configuration. Each statement must be written in the top box, and no space can be left on the left, otherwise an error will occur.
Among them, pwd.conf and authz.conf will not be automatically created by the system when creating a new repository, and you need to create them yourself.
Instruction introduction: This is the format of the svn configuration file, please write in the above format.

4 Configure the user

[root@DB2 conf]# vi /opt/svndata/repos/conf/passwd

Insert the following content

[users]
haifeng = 123456
game = 123456

You can add more than one, this is the username and password pair.


5 Configure permissions

[root@DB2 conf]# vi /opt/svndata/repos/conf/authz

Insert the following content

[/]

haifeng = rw
game = r

List the authorization for each user. Including read-only r, read-write rw. No user listed, access is not allowed. You can also group users. For details, please refer to the svn manual.

6 Start the svn service

[root@DB2 conf]# svnserve -d -r /opt/svndata/

Command Introduction: This command is used to start the svn service, -d indicates that it runs in daemon mode, and svn automatically listens on port 3690. 3690 is the default port, you can use "--listen-port=" or "--listen-host=" to specify other
ports . The -r option is used to specify the root directory of the svn service, so that users can use relative paths to access instead of providing full paths.

7. Check the port

[root@DB2 conf]# netstat -ntlp|grep 3690
tcp 0 0 0.0.0.0:3690    
0.0.0.0:* LISTEN 15087/svnserve



to this svn build configuration is completed, you can connect to use on the client.

Connection address: svn://service IP/repos

Problems encountered in Chapter 3 The

following are the problems I encountered. Maybe the environment is different, and other problems will occur, but I have not encountered them.

1. OpenSSL

When configure configures SVN, the following error message may be displayed:

configure: error: We require OpenSSL; try --with-openssl

Solution:

The error prompts that openssl needs to be installed, so I installed an openssl. The installation method is as follows:

Download openssl: http: //www.openssl.org/source/openssl-1.0.0a.tar.gz

cd /usr/local

tar -zxvf openssl-1.0.0a.tar.gz

cd openssl-1.0.0a

./config

./config -t

make depend

make

make test

make instal

After installation, a ssl directory will be generated under /usr/local, and the openssl path will be added when

configuring SVN./configure --prefix=/opt/subversion --without-berkeley-db --with- openssl=/usr/local/ssl

2. zlib

configure may prompt the following error message when configuring SVN:

configure: error: subversion requires zlib The

error prompts that zlib needs to be installed

. Download zlb: http://zlib.net/

cd /usr/local

tar -xvzf zlib-1.2.5.tar.gz

cd zlib-1.2.5

./configure

make

make install 3. The following error message may be displayed when

expat configure configures SVN: configure: error: no XML parser was found: expat or libxml 2.x required The error prompts that expat needs to be installed . Download expat: http://sourceforge.net/project/showfiles.php?group_id=10127 cd /usr/local tar -xvzf expat2.tar.gz cd expat2 . /configure make make install This is the end. If you still encounter other problems, let's go to Baidu. Chapter 4 Self-start at boot Put /opt/subversion/bin/svnserve -d -r /opt/svndata --listen-host server IP in the last line of /etc/rc.d/rc.local

























Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326866713&siteId=291194637