Install and configure SVN servers in centos 5.2

Source: Internet
Author: User
Tags svn client svn update

After installing the svn server, this article is not integrated with Apache. The process is as follows:

1. Download related software:

[Root @ youxia201 test] # wget http://subversion.tigris.org/downloads/subversion-1.6.1.tar.gz

[Root @ youxia201 test] # wget http://subversion.tigris.org/downloads/subversion-deps-1.6.1.tar.gz

 

Ii. installation and configuration:

1. decompress the package in the same directory:

[Root @ youxia201 opt] # tar-zxvf subversion-1.6.1.tar.gz

[Root @ youxia201 opt] # tar-zxvf subversion-deps-1.6.1.tar.gz

 

2. Compilation and installation:

[Root @ youxia201 subversion-1.6.1] #./configure -- prefix =/usr/local/SVN/

[Root @ youxia201 subversion-1.6.1] # Make & make install

 

3. Add svn-related commands to environment variables:

[Root @ youxia201 subversion-1.6.1] # echo "Export Path = $ path:/usr/local/SVN/bin/">/etc/profile

[Root @ youxia201 subversion-1.6.1] # source/etc/profile

 

3. Create a test warehouse:

1. Create the svn root directory. The R & D center has multiple project departments:

[Root @ youxia201 subversion-1.6.1] # mkdir-P/opt/SVN/

 

2. Create a test warehouse:

[Root @ yoia201 subversion-1.6.1] # mkdir-P/opt/SVN/svntest/

[Root @ youxia201 subversion-1.6.1] # svnadmin create/opt/SVN/svntest/

 

3. modify the configuration file:

[Root @ youxia201 svntest] # cd/opt/SVN/svntest/CONF/

[Root @ youxia201 conf] # vi svnserve. conf

[General]

Anon-access = none

Auth-access = write

Password-DB = passwd

Authz-DB = authz

 

[Root @ youxia201 conf] # vi authz

[Svntest:/]

Lipeng = RW

# Add a user named Li Peng to the svntest repository with the write permission.

 

[Root @ youxia201 conf] # vi passwd

Lipeng = 123456

# Because it is a test, set the password to 123456

 

4. Install the svn client on Windows XP:

1 ,:

Http://code.google.com/p/rails4scm/downloads/detail? Name = tortoisewin32svn. MSI

2. After the download is complete, directly install the tool next. After the installation is complete, restart the tool to take effect.

 

V. Start server and test:

1. Enable the svn service and specify the svn root directory:

[Root @ youxia201 test] # svnserve-d-r/opt/SVN/

 

2. The Service is working properly:

[Root @ youxia201 test] # netstat-tunlp | grep SVN

TCP 0 0 0.0.0.0: 3690 0.0.0.0: * Listen 8646/svnserve

 

3. test:

Create a directory named svntest on the desktop, right-click the directory, select checkout, and enter the svn Server IP address and repository name in the first line.

 

Enter the user name and password.

 

How to synchronize data to the web directory?

Run the checkout command to check out the current project to the web directory before synchronization.

SVN checkout SVN: // localhost/default (run the command after entering the web directory)

In order to complete the modificationCodeAfter the file is submitted to the svn server, the web server directly synchronizes the file. You need to configure the svn hook and open the hooks directory,
We can see that there is a post-commit.tmpl file, this is a template file,
Copy a copy to this directory and name it post-commit.
All the original code in the file is commented out. You can run the shell command to call this file every time the commit is completed.
My file content is
#! /Bin/sh
Export lang = zh_cn.gbk
/Usr/local/SVN/bin/SVN update -- username Lida -- password Lida SVN: // localhost/default/www/web/
Note:
#! /Bin/sh indicates that the shell command is executed.
Export lang = zh_cn.gbk is used to solve SVN post commit
Chinese garbled characters, set local encoding, because my system is GBK encoding, SVN is the UTF-8 encoding by default, if not set will occur error, but the execution is not successful, the error is identified as SVN:
Can't convert string from native encoding to 'utf-8'
/Usr/local/SVN/bin/SVN update -- username Lida -- password Lida SVN: // localhost/default/www/web/perform the update operation
If the prompt is: Post-commit hook failed (exit code 255) with no output, grant the post-commit file executable permission
If your default encoding is UTF-8, to upload a Chinese file, first save the file as UTF-8 format before submitting

ArticleReprinted from: http://chlotte.blog.51cto.com/318402/382700

Related Article

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.