Install and configure SVN in linux

Source: Internet
Author: User
For details about how to install and configure SVN in linux-Linux Enterprise Application-Linux server application, see the following. Svn Installation
Next, let's take a look at the working principles of SVN when talking about the svn installation steps.
Let's use a small example to introduce svn. If there is a project that requires multiple developers to develop together, but these developers are not in one place, how can we complete this project, how can I make changes to some files or programs to be quickly obtained by other project personnel? At this time, we need a management software to manage the project development program. But how can we solve the synchronization, security, and management problems of the project program?
SVN is a management software that has recently emerged and is the successor of csv. Currently, many open-source software uses svn as the management software.
The basic working principle of SVN: Build a source code library on a server, and store many different source codes in the library. The source code library administrator manages these source codes in a unified manner. When every user uses these source codes, all files in the source code library must be downloaded to the local device. After that, developers can modify the files locally and submit the files using svn commands. Then, the files are managed and modified in the source code library.
Solved problems:
Chaotic code management
Solve the difficulty of code conflict management
Bugs during code Integration
Insufficient permission control for the owner
Different projects make release difficult
Here are some svn installation steps:
Here, we will not only introduce the installation of svn, but also introduce some configuration and usage under the win client.
I have installed it on centos 5.3. What you need to prepare in the early stage is the gcc compiler. It is best to build a YUM to help you solve the problem during the installation process, if some packages are missing, you can refer:
Http://1413570.blog.51cto.com/1403570/631226
Next we will start our bitter journey, and we will encounter many difficulties on the way. Come on!
Download two packages first,
Subversion-1.7.2.tar.gz
Subversion-deps-1.6.1.tar.gz
These two packages can be downloaded from http://down.51cto.com/data/314148
Decompress:
Tar-zxvf subversion-1.7.2.tar.gz
Tar-zxvf subversion-deps-1.6.1.tar.gz
Go to the directory and prepare for compilation and installation:
[Root @ localhost software] # cd subversion-1.7.2.
[Root @ localhost subversion-1.7.2] # specify the installation path under home. zlib requires zlib-devel-. Check that this package is used by the FSFS file system.
The first error encountered during installation,
Checking for APR... no
Configure: WARNING: APR not found
The Apache Portable Runtime (APR) library cannot be found.
Please install APR on this system and supply the appropriate
-- With-apr option to 'configure'
Solution:
To the tar-zxvf subversion-deps-1.6.1.tar.gz unzipping directory, there is an apr folder, put it under subversion-1.7.2
[Root @ localhost subversion-1.7.2] # cp-rf.../subversion-1.6.1/apr.
OK, and then run the./configure command again.
The second error:
Checking APR version... 1.3.3
Configure: Apache Portable Runtime Utility (APRUTIL) library configuration
Checking for APR-util... no
Configure: WARNING: APRUTIL not found
The Apache Portable Runtime Utility (APRUTIL) library cannot be found.
Either install APRUTIL on this system and supply the appropriate
The prompt is that the apache port is not found, because this installation is not combined with apache, to the tar-zxvf subversion-deps-1.6.1.tar.gz unzipped directory, found that there is an APR-util, and then moved to the ubversion-1.7.2 under
Run the./configure command again.
OK, the third error occurs,
Checking sqlite library version (via pkg-config)... no

An appropriate version of sqlite cocould not be found. We recommmend
3.7.6.3, but require at least 3.6.18.
Error prompt: Solution
Get the sqlite 3.7.6.3 amalgamation from:
Http://www.sqlite.org/sqlite-amalgamation-3.7.6.3.tar.gz
Unpack the archive using tar/gunzip and copy sqlite3.c from
Resulting directory:
/Home/software/subversion-1.7.2/sqlite-amalgamation/sqlite3.c
Download this package, decompress it, and place sqlite3.c in the specified location.
Http://down.51cto.com/data/314253
Download and decompress
Unzip sqlite-amalgamation-3070900.zip
[Root @ localhost software] # mkdir-p subversion-1.7.2/sqlite-amalgamation
[Root @ localhost software] # cd sqlite-amalgamation-3070900
[Root @ localhost sqlite-amalgamation-3070900] # cp sqlite3.c ../subversion-1.7.2/sqlite-amalgamation/
After? Why? /Configure
See this. Run OK in config.
Checking for ctypesgen. py... none
Configure: creating./config. status
Config. status: creating Makefile
Config. status: creating tools/backup/hot-backup.py
Config. status: creating tools/hook-scripts/commit-access-control.pl
Config. status: creating subversion/bindings/swig/perl/native/Makefile. PL
Config. status: creating subversion/svn_private_config.h.tmp
Config. status: executing libtool commands
Config. status: executing svn_private_config.h.tmp commands
[Root @ localhost subversion-1.7.2] # make clean [
Root @ localhost subversion-1.7.2] # make & make install
If no error is encountered, it is OK,
Cd subversion/po;/usr/bin/install-c-m 644 zh_TW.mo/home/svn/share/locale/zh_TW/LC_MESSAGES/subversion.mo
Test-d/home/svn/include/subversion-1 | \
/Usr/bin/install-c-d/home/svn/include/subversion-1
(Subversion/svnversion. 2>/dev/null | \
Svnversion. 2>/dev/null | \
Echo "unknown ";\
)>/Home/svn/include/subversion-1/svn-revision.txt
[Root @ localhost subversion-1, 1.7.2] #
Now we can find the svn directory under home, indicating that our installation is complete. [root @ localhost home] # cd svn/
[Root @ localhost svn] # ls
Bin build-1 include lib share
[Root @ localhost svn] # pwd
/Home/svn
[Root @ localhost svn] #
To allow the system to find these commands, you also need to add these commands to the system's environment variables. Operation:
Vi/etc/profile
Find export PATH
Export PATH =/home/svn/bin: $ PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
Command: [root @ localhost bin] # source/etc/profile
Make the profile file take effect
[Root @ localhost bin] # svnserve -- version
Svnserve, version 1.7.2 (r1207936)
Compiled on Dec 29, 2011,17: 17: 19
Install OK
The following describes how to configure svn and how to configure the win client.
This operation follows the policy of creating a version library for each project. The configuration file, authentication, and password are all placed under the version library. Therefore, each time a new project is started, you need to create a version library for the project and reconfigure the relevant files. In addition, you also need to re-specify the version library path on the client.
Directory of the current database (multiple directories can be created. You must reconfigure the following items after creating a new database. Note the differences between the installation directory and the version library directory. The following describes the version library directory)
[Root @ localhost home] # mkdir-p/home/svndata/repo
Create the svn version Library (corresponding to the above directory)
Svnadmin create/home/svndata/repo/
After executing this command, svn automatically adds the required configuration file under the repos directory. You can view
Modify the version Library File
Go to the/home/svndata/repo/conf directory.
[General] anon-access = none # Make unauthorized users inaccessible
Auth-access = write # grant the authorized user the write permission
Password-db =/home/svndata/repo/conf/password # specify the password file path
Authz-db =/home/svndata/repo/conf/authz. # access control file
Realm =/home/svndata/repo # to authenticate the 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.
Configure user vi/home/svndata/repo/passwd # add user name and password

[Users]
# Harry = harryssecret
# Sally = sallyssecret
Admin = admin
Wwb = biao_123
5. Configure the permission/home/svndata/repo/conf/authz file.
This configuration file adopts the "Path-based authorization" policy, which specifies the path in brackets. The following lists the authorization policies for users. Including read-only r and read/write rw. Users not listed are not allowed to access. You can also group users,
[/Sa]
# [Sa] refers to the local library file, which will be introduced later
Admin = rw
Wwb = r
Start the service to execute svnserve? D? R/home/svndata/repo this is a recommended method for small team projects. this method has the least maintenance and the simplest configuration. command Description: 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. Run the following command to check out svn checkout svn: // 127.0.0.1/dir. The IP address needs to be adjusted according to the actual situation. dir is the version library path. If it is specified at startup, it can be omitted. The version library information is in the version library folder. to delete a version library, you only need to delete the folder where the version library is located. In addition, work copies are only self-maintained folders, which can be deleted directly in Windows without affecting others. Do not use the DELETE command of the version library. Otherwise, the content in the version library will be deleted.
Start:
[Root @ localhost conf] # svnserve-d-r/home/svndata/repo/
[Root @ localhost conf] # netstat-antp | grep svn
Tcp 0 0 0.0.0.0: 3690 0.0.0.0: * LISTEN 6397/svnserve
The default port is 3690. In the firewall configuration file, add Port 3690 to [root @ localhost conf] # vi/etc/sysconfig/iptables
-A RH-Firewall-1-INPUT-p tcp-m state -- state NEW-m tcp -- dport 3690-j ACCEPT
[Root @ localhost conf] # service iptables restart iptables
View iptables rule chains
14 ACCEPT tcp -- anywhere state NEW tcp dpt: svn
OK. The current configuration is complete. The following describes how to configure the client in win.
Download the TortoiseSVN-1.6.6.17493-win32-svn-1.6.6.msi client under win, install
Configure the local library under the hard drive under win


Connected.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.