Although it is very simple to build SVN on Windows, the performance is not high. This is of course compared with Linux. However, building SVN on Linux is very cumbersome, so today’s article is here Teach you step by step how to build SVN on Centos
Installation
#yum install subversion
1) Create svn user
#groupadd svn
#useradd -g sky user//Add user to sky??
Switch user
#su svn
In the future, this account will be used to create and maintain the code base. .
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 repository:
#svnadmin create --fs-type fsfs web
At this time in /opt/lampp/htdocs/_svn/ Appears under web: conf/ db/ format hooks/ locks/ README.txt
3) Set the username and password for web access
Edit file /opt/lampp/htdocs/_svn /web/conf/passwd
Set the user name and password in [users] according to the following format:
Username 1=Password 1
Username 2=Password 2
For example, test=test, indicating user name It is test, and the password is also test
??File/opt/lampp/htdocs/_svn/web/conf/authz
[groups]
www=7di,user1,user2,user3,user4, user5,user6,wasing
[/]
@www=rw
*=
Edit file /opt/lampp/htdocs/_svn/web/conf/svnserve.conf
Add a few lines of configuration:
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
Note that these lines of configuration There cannot be any spaces in the first letter of the line, otherwise errors like svnserve.conf:12: Option expected will appear
Well, with the above configuration, your svn will be fine.
4) Connect
If svn is already running, you can change the port to run
svnserve -d -r /opt/lampp/htdocs/_svn/ web --listen-port 3391
In this way, the same server can run multiple svnserver
or use the following command to kill the process
netstat -ntlp
kill -9 id
Okay, after successful startup, you can use it.
It is recommended to use TortoiseSVN. The connection address is: svn://URL/?Project name? (If you specify a port, you need to add port: port number)
After connecting, you can upload local files and effectively manage your code
If the connection is out, check the fire protection 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 into the automatic startup script at boot:
Modify the file as root: /etc/rc .d/rc.local, add the following text:
su -c /opt/lampp/htdocs/_svn/start_svn.sh svn