1. Test environment
centos5.5
2. Install SVN
Yum-y Install Subversion //Test SVN is installed successfully, execute: Svnserve--version
3. Configuration
Mkdir/www/svndata //Build Repository directory
Attached: Killall svnserve//Stop SVN service
4. Build the Repository
Create a new Subversion project
Svnadmin Create/www/svndata/oplinux
Configuration allows user rsync access
Cd/www/svndata/oplinux/conf
VI svnserve.conf
Anon-access=none
Auth-access=write
password-db=passwd
Note: There must be no space in front of the modified file, otherwise there is an error starting SVN server
VI passwd
[Users]
#< User 1> = < password 1>
#< User 2> = < password 2>
Rsync=rsync
5. Client Connection
SVN Co svn://ip/oplinux
User name password: rsync
Then the project is guided by the client
Linux Import:
SVN import Peer svn://localhost/alidata/svndata/ptp-m "PTP";
Local checkout one out, server side co one out, command is
SVN Co svn://localhost/oplinux/www/webroot
Remember to start the service the general name is Svnservice
/*linux SVN general Operation */
The following is an example of BBS this folder
SVN add svn (ADD)
SVN commit–m "Commit 20131023" BBS
Svnserve-d-r/www/svndata bind the SVN service to this directory
Installation encountered problems:
Problems encountered during installation:
Cannot bind server socket:address already in use occurs when Svnserve is started
Workaround:
Method One: Find out Svnserve ID kill process
Netstat-ntlp
Kill-9 ID
Method Two: Re-specify a port number (default port 3690)
svnserve-d--listen-port 3691-r/opt/svndata/svnrepo
Permission Description
[Groups]devteam = Iitshare, Itblood #devteam project group consists of two users iitshare,itblood[/]iitshare = Rwitblood =[TSHOP:/TB2C] @devteam = Rwitblood =[TSHOP:/TB2B2C] @devteam = Rwitblood = R
Of these, 1 user groups can contain 1 or more users, separated by commas between users.
Description
DevTeam = iitshare, Itblood #devteam project group consists of two users iitshare,itblood[/]iitshare = RW #iitshare have read and write permissions to the root directory Itblood = #itblood to the root directory Have any permission # # # #如果需要配置tb2c, TB2B2C project permissions, precondition is tshop warehouse below need to have these two items # # # #如果没有的话, Tshop will not be able to access [TSHOP:/TB2C] # Permission control for the TB2C project of the Tshop warehouse @devteam = RW #控制 devteam Group has read and write access to the TB2C project Itblood = #限制 Itblood All permissions, other users have read and write access [TSHOP:/TB2B2C] #对 tshop: The TB2B2C project of the warehouse has permission control @devteam = RW #限制 devteam Group has read and write permission to TB2B2C project Itblood = r #限制 Itblood Read only, other users have read and write permission
6. Note:
* The user name that appears in the permissions profile must already be defined in the user profile.
* Changes to the permissions profile take effect immediately and do not have to restart SVN.
User group format:
[Groups]=, where 1 user groups can contain 1 or more users, separated by commas. Repository directory format:[< repository >:/project/directory]@< user Group name > = < permissions >< User name > = < permissions >
Where the box number can be written in several ways:
[/], indicating the root directory and the following, the root directory is specified at svnserve startup, and we specify as/home/svndata,[/] means to set permissions on all repository.
[tshop:/] means setting permissions for the repository tshop;
[TSHOP:/ABC] means setting permissions on the ABC project in the Repository tshop;
[TSHOP:/ABC/AAA] means setting permissions on the AAA directory of the ABC project in the Repository tshop;
A permission principal can be a user group, user, or *, and the user group is preceded by @,* to represent all users.
Permissions can be W, R, WR, and NULL, and NULL indicates no permissions.
7, set up the user to start SVN
Useradd SVN
Follow the prompts to set a password for the user svn
Allow user svn access to repository:
Chown-r SVN:SVN/OPT/SVN
8. Start SVN:
Way one: svnserve-d-r/opt/svn/#默认的启动端口号为3690
Way two: Su–svn-c "Svnserve-d–listen-port 9999-r/opt/svn/"
which
SU–SVN means to start svn as the user svn;
-d means running in daemon mode (background run);
–listen-port 9999 means using 9999 ports, which you can replace with the ports you need. Note, however, that using a port under 1024 requires root access;
-R/OPT/SVN specifies that the root directory is/OPT/SVN.
9, check whether to start
NETSTAT-TUNLP | grep SVN
If the following information is displayed stating that the startup was successful
TCP 0 0 0.0.0.0:9999 0.0.0.0:* LISTEN 10973/svnserve
10. 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–listen-port 9999-r/OPT/SVN
11. If you want to stop SVN, use the following command:
Killall Svnserve
12. If you want to use SVN as a service:
Create a new file named SVN in the/etc/rc.d/init.d/directory
and set the permissions to 755:chmod 755/ETC/RC.D/INIT.D/SVN
To edit the svn file: VI/ETC/RC.D/INIT.D/SVN, add the following code:
#!/bin/bash# build this file in/etc/rc.d/init.d/svn# chmod 755/etc/rc.d/init.d/svn# CentOS can be managed with the following command Svn:service SVN STA RT (Restart/stop) svn_home=/opt/svnif [!-F "/usr/local/svn/bin/svnserve"]then echo "Svnserver startup:cannot Start " exitficase" "In Start" echo "starting svnserve ..." /usr/local/svn/bin/svnserve-d-- Listen-port 9999-r $SVN _home echo "finished!" ; Stop) echo "stoping svnserve ..." killall svnserve echo "finished!" ;; Restart) $ Stop $ start ; *) echo "USAGE:SVN {start | Stop | Restart} " exit 1esac
You can then start SVN with service svn start (restart/stop).
There are many ways to access SVN through the web, see Configuring WEBSVN or configuring Bssvnbrowser methods
Centos6.5 Installing SVN with Yum