Svn installation 1
1. Download the subversion installation package, decompress it, and enter the subversion directory.
Wget http://subversion.tigris.org/downloads/subversion-1.6.6.tar.gz
Wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.gz
Tar xfvz subversion-1.6.6.tar.gz
Tar xfvz subversion-deps-1.6.6.tar.gz
Cd subversion-1.6.6
2. Compile the file
First, check whether the system has installed SSL:
Find/-name opensslv. h
If not, run the following command for installation:
Yum install openssl-devel
After installation, run the find/-name opensslv. h command to find the directory where opensslv. h is located, that is, the path following-with-openssl =,
Run the compilation:
./Configure -- prefix =/usr/local/svn -- with-openssl =/usr/include/openssl -- without-berkeley-db
3. Install
First, perform the following operations:
(1) edit the ld. so. conf file:
Vi/etc/ld. so. conf
Add the following line:
/Usr/local/lib
(2) save and run ldconfig:
/Sbin/ldconfig
Make & make install
(3) after the installation is complete, run the following command to test:
/Usr/local/svn/bin/svnserve -- version
To facilitate the following operations, add the svn bin to PATH:
Vi/etc/profile
Add the second to the last row:
PATH =/usr/local/svn/bin: $ PATH
Save and make it take effect immediately:
Source/etc/profile
4. Configure svn
Create a version Library Directory. You can create multiple directories:
Mkdir-p/home/svndata/repos
Create a version Library:
Svnadmin create/home/svndata/repos
Modify the version Library configuration file:
Vi/home/svndata/repos/conf/svnserve. conf
[General]
Anon-access = read
Auth-access = write
Password-db =/usr/local/svn/conf/passwd. conf
Authz-db =/usr/local/svn/conf/authz. conf
Realm = repos
Other annotations can be deleted.
5. Create password files and authentication files
Create a conf file under/usr/local/svn/.
Create the passwd. conf and authz. conf files in the/usr/local/svn/File:
Cd/usr/local/svn/
Mkdir conf
Touch passwd. conf
Touch authz. conf
Add user and password:
Vi/usr/local/svn/conf/passwd. conf
Add and save the following code:
[Users]
ClvalueDQ = 123456
Svn = 1, 1234567
Configure svn user access permissions:
Vi/usr/local/svn/conf/authz. conf
[Groups]
Admin = wll, svn
[/]
@ Admin = rw
[Repos:/]
@ Admin = rw
Svn configuration is complete.
Create a user to start svn:
Useradd svn passwd svn
Set a password for svn as prompted.
Allow user svn to access the version Library:
Chown-R svn: svn/home/svndata
Start svn:
If an error is reported
Svnserve: cannot bind server socket: The address is already in use
Then the process is killed first.
Killall svnserve
Restart
Svnserve-d-listen-port 9999-r/home/svndata
6. Add svn to startup
Edit the rc. local file:
Vi/etc/rc. d/rc. local
Add the following startup command:
/Usr/local/svn/bin/svnserve-d -- listen-port 9999-r/home/svndata
7. Connect to SVN
Install TortoiseSVN and restart the system.
Start TortoiseSVN and enter svn: // 192.168.x.x: 9999/repos in the address bar.
Enter the user name and password as prompted to use version control.
You can enter the URL 192.168.x.x: 9999/repos in the local browser.
Display
(Success (2 2 () (edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops partial-replay )))
8. Enable permission verification
Svn co svn: // 192.168.3.109/repos-username wll-password 123456
Display:
------------------------
ATTENTION! Your password for authentication realm:
<Svn: // 192.168.3.109: 3690> repos
Can only be stored to disk unencrypted! You are advised to configure
Your system so that Subversion can store passwords encrypted, if
Possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
Of the 'store-plaintext-password' option to either 'yes' or 'no' in
'/Root/. subversion/servers '.
------------------------
Save unencrypted password (yes/no )?
Select yes
9. Note:
Common errors
(1) an error is reported, indicating that "the target machine is actively rejected" cannot be connected, mainly because of the firewall.
You need to enable Port 9999 to edit iptables
Vi/etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Tue Jul 23 09:58:01 2013
* Filter
: Input accept [0: 0]
: Forward accept [0: 0]
: Output accept [2: 80]
-A input-p tcp-m tcp-dport 80-j ACCEPT
-A input-m state-state RELATED, ESTABLISHED-j ACCEPT
-A input-p icmp-j ACCEPT
-A input-I lo-j ACCEPT
-A input-p tcp-m state-state NEW-m tcp-dport 22-j ACCEPT
-A input-p tcp-m state-state NEW-m tcp-dport 9999-j ACCEPT
-A input-j REJECT-reject-with icmp-host-prohibited
-A forward-j REJECT-reject-with icmp-host-prohibited
COMMIT
# Completed on Tue Jul 23 09:58:01 2013
Save and restart the firewall
[Root @ localhost conf] # service iptables restart
(2) svn: Invalid authz configuration or svn: the authentication function fails.
Most of them are errors in the authz. conf file and errors in the svnserve. conf file.
Vi/usr/local/svn/conf/authz. conf
[Groups]
Admin = wll, svn
[/] # Do not have spaces
@ Admin = rw
[Repos:/]
@ Admin = rw
Vi/home/svndata/repos/conf/svnserve. conf
[General]
Anon-access = read # do not have spaces
Auth-access = write # do not have spaces
Password-db =/usr/local/svn/conf/passwd. conf
Authz-db =/usr/local/svn/conf/authz. conf
Realm = repos
After the format is saved
Svn co svn: // 192.168.3.109: 9999/repos
Enter the password in sequence
Svn installation 2
1. Download related software
Wget http://subversion.tigris.org/downloads/subversion-1.6.1.tar.gz
Wget http://subversion.tigris.org/downloads/subversion-deps-1.6.1.tar.gz
II. Installation and configuration
1. Decompress: (in the same directory)
Tar-zxvf subversion-1.6.1.tar.gz
Tar-zxvf subversion-deps-1.6.1.tar.gz
2. Compile and install:
./Configure -- prefix =/usr/local/svn/
Make & make install
3. Add SVN-related command paths to environment variables
Echo "export PATH = $ PATH:/usr/local/svn/bin/">/etc/profile
Source/etc/profile
3. Create a test warehouse
1. Create the SVN root directory
Mkdir-p/opt/svn/
2. Create a test warehouse
Mkdir-p/opt/svn/svntest/
Svnadmin create/opt/svn/svntest/
3. Modify the configuration file
There are three files in the cd/opt/svn/svntest/conf/directory:
Svnserve. conf is the svn configuration file.
Authz is the configuration file for setting user permissions (the file name can be customized, which is specified in authz-db = authz of svnserve. conf)
Passwd is the configuration file for setting the user name and password (the file name can be customized, which is specified in password-db = passwd of svnserve. conf)
Vi svnserve. conf
Modify as follows:
[General]
Anon-access = none
Auth-access = write
Password-db = passwd
Authz-db = authz
========================================================== ======================================
Vi authz
Modify as follows:
[Svntest:/]
92csz.com = rw
# Add a user named 92csz.com to the svntest warehouse with the write permission.
========================================================== ======================================
Vi passwd
Modify as follows:
92csz.com = 123456
# Because it is a test, set the password to 123456
4. Install the svn client on the client
1. Download address:
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 the server and test
1. Enable the SVN service and specify the SVN root directory:
Svnserve-d-r/opt/svn/
2. Check whether the service is normal:
Netstat-tunlp | grep svn
The result is as follows, indicating that port 3690 is listened to normally.
Tcp 000.0.0.0: 255.00.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.