How to configure Svn in Linux
1. Compile and install source files. There are two source files: 1. download the Subversion source file subversion-1.6.1.tar.gzhttp: // repository. download the Subversion dependency file subversion-deps-1.6.1.tar.gzhttp: // license Note: The two file versions must be consistent, otherwise it is easy to cause problems. ii. decompress the file and compile and configure subversion1. unzip the file [root @ DB2 tfhudong] # tar zxf subversion-1.6 .1.tar.gz [root @ DB2 tfhudong] # tar zxf subversion-deps-1.6.1.tar.gz Note: Be sure to extract the two files to the same directory, otherwise the following issues will occur. 2. Go to the unzipped subversion directory [root @ DB2 ~] # Cd, USR, local, and subversion-1.6.1/3. create the installation directory [root @ DB2 subversion-1.6.1] # mkdir/usr/local/SVN 4. compile and install subversion (1 ). /configure -- prifix =/usr/local/SVN # SVN has two modes: one is the default mode for fsfs and the other is the bdb mode. fsfs is recommended. If an error occurs: Configure: Error: no suitable APR found, it is caused by the fact that the preceding dependent files are not decompressed to the same directory... (2) Compile and install [root @ DB2 subversion-1.6.1] # Make [root @ DB2 subversion-1.6.1] # make install (3) test whether the installation is successful [root @ DB2 subversion-1.6.1] #/usr/local/subversion/bin/svnserve -- versionsvnserve, version 1.6.1 (r37116) compiled on Mar 4 2011,10: 07: 53 (4) You can add the command to the environment variable VI/etc/profile and write the following two statements Path = $ path: /usr/local/subversion/binexport path source/etc/profile 5. the installation of basic SVN is OK. Let's configure SVN. 3. Configure SVN 1. create a version library directory (this directory should be separated from the installation directory. The following describes the version Library) [root @ DB 2 subversion-1.6.1] # mkdir-P/opt/svndata/Game 2 create an SVN repository [root @ DB2 subversion-1.6.1] # svnadmin create/opt/svndata/GAME/execute this after the command, SVN automatically adds the required configuration file under the repos directory. [root @ DB2 subversion-1.6.1] # ls/opt/svndata/GAME/conf dB format hooks locks readme.txt note: the version library is different from the general folder, creating a file directly on the operating system cannot be identified by SVN. You must use commands such as import to import the file to the version library. this is an internal SVN command. Create is used to create a version library. Use SVN help to view detailed instructions. 3. Modify the version database configuration file [root @ DB2 conf] # vi/opt/svndata/GAME/CONF/svnserve. the conf parameter functions are described in the remarks in the configuration file. The configuration is as follows: [general] anon-access = none # Make unauthorized users unable to access auth-access = write # Enable authorized users to write password-DB = passwd # specify the password file path authz-DB = authz # access control file realm =/opt/svndata/game # authentication namespace, the Subversion is displayed in the authentication prompt and serves as the key word cached by the credential. Others adopt the default configuration. Each statement must be written in the top level, and no space is left. Otherwise, an error occurs. Instruction Description: This is the format of the svn configuration file. Please follow the above format. 4 configure the user [root @ DB2 conf] # vi/opt/svndata/GAME/CONF/passwd to insert the following content [users] Haifeng = 123456 game = 123456 you can add multiple, this is a user name and password pair. 5. Configure the permission [root @ DB2 conf] # vi/opt/svndata/GAME/CONF/authz and insert the following content [/] Haifeng = rwgame = r to list the permissions granted to users. Including read-only R and read/write RW. Users not listed are not allowed to access. You can also group users. For details, refer to SVN manual 6 to start the svn service [root @ DB2 conf] # svnserve-d-r/opt/svndata/GAME/command introduction: this command is used to start the svn service.-D indicates that the command runs in daemon mode and SVN automatically listens on port 3690. 3690 is the default port. You can use "-- listen-Port =" or "-- listen-host =" to specify other ports. The-r option is used to specify the root directory of the svn service, so that you can use the relative path for access without providing the complete path. 7. check the port [root @ DB2 conf] # netstat-ntlp | grep listen TCP 0 0 0.0.0.0: 3690 0.0.0.0: * Listen 15087/svnserve. The SVN configuration has been completed, you can connect to the client. 8. Verify 1) import the folder first
2) enter the account name and password
3) SVN check directory
4) SVN added successfully