Centos builds svn service

Although it is very simple to build SVN on windows, the performance is not high, which is of course compared with linux. However, it is very cumbersome to build SVN on linux, so today this article will teach you step by step how to build on Centos SVN

Install
#yum install subversion

1) Create svn user
#groupadd svn
#useradd -g sky user// is to add user to sky group. After
switching user
#su svn
, the creation and maintenance of the code base are all operated with this account.

2) Create a repository
Edit .bash_profile and add the following configuration
SVN_HOME=/opt/lampp/htdocs/_svn
export SVN_HOME
PATH=$PATH:$SVN_HOME/bin
export PATH

Create a repository:
#svnadmin create --fs-type fsfs web
Now it appears under /opt/lampp/htdocs/_svn/web: conf/db/format hooks/locks/README.txt

3) Set the username and password for web access
Edit the file /opt/lampp/htdocs/_svn/web/conf/passwd
in [users] and set the username and password in the following format:
username1=password1
username2=password2
for example test=test, indicating that the username is test and the password is also test

Edit file /opt/lampp/htdocs/_svn/web/conf/authz
[groups]
www=7di,user1,user2,user3,user4,user5,user6,wasing

[/]
@www=rw
*=

Edit the file /opt/lampp/htdocs/_svn/web/conf/svnserve.conf
and add a few lines of configuration: anon
-access = read
auth-access = write
password-db = passwd
authz-db = authz
The first letter of the line cannot have any space, otherwise an error like svnserve.conf:12: Option expected will appear.
Well, through the above configuration, your svn will be fine.

4) Connect

If svn is already running, you can run
svnserve -d -r /opt/lampp/htdocs/_svn/web --listen-port 3391 on a different port
, so that the same server can run multiple svnservers

Or kill the process with the following command
netstat -ntlp
kill -9 id

Well, after the startup is successful, it can be used.
It is recommended to use TortoiseSVN, the connection address is: svn://URL/project name (if you specify a port, you need to add a port: port number)
After connecting, you can upload local files to effectively manage your code

If the connection fails, please check the firewall settings
#vi /etc/sysconfig/iptables
add: -A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
#service iptables restart

Create a script to start Subversion:
#echo 'svnserve -d -r /opt/lampp/htdocs/_svn/' > start_svn.sh #chmod
0777 start_svn.sh
#./start_svn.sh

Place the startup script in the boot autostart script:
Modify the file as root: /etc/rc.d/rc.local and add the following text:
su -c /opt/lampp/htdocs/_svn/start_svn.sh svn

Guess you like

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