Build SVN in CentOS (source code compilation and installation)

Source: Internet
Author: User
Tags svn client tortoisesvn

Installation instructions

System Environment: CentOS-6.2

After installing the SVN server, this article is not integrated with Apache. The process is as follows:

1. Download related software:

[Root @ youxia201test] # wgethttp: // subversion.tigris.org/downloads/subversion-1.6.1.tar.gz

[Root @ youxia201test] # wgethttp: // subversion.tigris.org/downloads/subversion-deps-1.6.1.tar.gz



Ii. installation and configuration:

1. decompress the package in the same directory:

Export root@youxia201opt]#tar-zxvfsubversion-1.6.1.tar.gz

Export root@youxia201opt]tar-zxvfsubversion-deps-1.6.1.tar.gz


2. Compilation and installation:

[Root @ localhost ~] # Cdsubversion-1.6.1

[Root@localhostsubversion-1.6.1] #./configure first compile, do not specify the path, to see if the error is reported

Error 1:

Configure: error: in '/root/subversion-1.6.1 ':

Configure: error: noacceptableCcompilerfoundin $ PATH this error indicates that the gcc language is not installed.

Solution: yuminstallgcc. Execute./configure again after installation to check whether an error is returned.


Error 2:

Configure: error: WerequireOpenSSL; try -- with-openssl is not installed with opensslopenssl-devel

Solution: yuminstallopensslopenssl-devel. Run the command again after installation./configure to check whether an error is returned.


Error 3:

Configure: error: noXMLparserwasfound: expatorlibxml2.xrequired

Solution: yuminstallexpat. If it cannot be installed, run the command again after installing the source code./configure to check whether an error is reported,

If there are still errors, follow the prompts to solve them. Baidu will not, until the following prompt is displayed:

BerkeleyDBhere:

Http://www.oracle.com/technology/software/products/berkeley-db/index.html

After the operation is successful, perform the following operations:

[Root@youxia201subversion-1.6.1] #./configure -- prefix =/usr/local/svn/

[Root@youxia201subversion-1.6.1] # make & makeinstall


3. Add svn-related commands to environment variables:

[Root@youxia201subversion-1.6.1] # echo "exportPATH = $ PATH:/usr/local/svn/bin/">/etc/profile

[Root@youxia201subversion-1.6.1] # source/etc/profile


[Root@localhostsubversion-1.6.1] # cd/usr/local/svn/

[Root @ localhostsvn] # ls indicates that the installation is successful.

Binbuild-1includelibshare

[Root @ localhost ~] #/Usr/local/svn/bin/svnserve -- version to view SVN version information. The version information is correct.

3. Create a test warehouse:

1. Create the SVN root directory. The R & D center has multiple project departments:

The [root@youxia201subversion-1.6.1] # mkdir-p/opt/svn/


2. Create a test warehouse:

# Mkdir-p/opt/svn/svntest/


# Svnadmincreate/opt/svn/svntest/



3. modify the configuration file:

[Root @ localhost ~] # Cd/opt/svn/svntest/

[Root @ localhostsvntest] # ls

ConfdbformathookslocksREADME.txt

[Root @ youxia201svntest] # cd/opt/svn/svntest/conf/

[Root @ youxia201conf] # ll

Total 24

-Rw-r -- 1rootroot71008-2509: 40 authz

-Rw-r -- 1rootroot32508-2509: 38 passwd

-Rw-r -- 1rootroot144908-2509: 36svnserve. conf



[Root @ youxia201conf] # visvnserve. conf modify the svn configuration file

[General]

Anon-access = none # Make unauthorized users inaccessible
Auth-access = write # grant the authorized user the write permission
Password-db = password # path of the password database
Authz-db = authz # access control file
All the preceding statements must be written in the top-level format, and spaces cannot be left on the left side. Otherwise, an error occurs.



[Root @ adminconf] # vimpasswd
Modify passwd to the following:

[Users]
# Harry = harryssecret
# Sally = sallyssecret

Hello = 123

Aaa = 123

Www = 1, 123

Username = Password

In this way, the hello user and 123 password are created.

All the preceding statements must be written in the top-level format, and spaces cannot be left on the left side. Otherwise, an error occurs.



[Root @ youxia201conf] # viauthz specifies the directory permissions of svn users

[Groups]

Admin = hello, www

[Svntest:/]

@ Admin = rw

Aaa = r

Add a user to a group and use the group to set permissions. You can directly set the user in the version library without having to rent the user. For example:

Aaa = r, which means that the aaa user has read permission on all directories in the svntest test database, while hello and www have read and write permissions.
If you use it on your own, read and write it directly.

All the preceding statements must be written in the top-level format, and spaces cannot be left on the left side. Otherwise, an error occurs.



[Root @ localhostconf] # svnserve-d-r/opt/svn/svntest/start the SVN Test Library

If svn is already running, you can run it on another port.
Svnserve-d-r/opt/svn/-- listen-port3391



4. Start the server and test:

1. Enable the SVN service and specify the SVN root directory:

[Root @ youxia201test] # svnserve-d-r/opt/svn/

Note that/opt/svn is the root directory of the repository and should not overlap with the [svntest:/] Directory. An error will be prompted if the overlap occurs.

[Root @ localhostconf] # svncosvn: // 127.0.0.1 test the effectiveness of svn on the local machine

Certification field: <svn: // 127.0.0.1: 3690> ed4c06a0-3c8f-11e3-b7ad-e704fa0b2aec

User name: hello

"Hello" password:

-----------------------------------------------------------------------

Note! Your password, for the authentication domain:

<Svn: // 127.0.0.1: 3690> ed4c06a0-3c8f-11e3-b7ad-e704fa0b2aec

Only files on disks can be stored in plain text! If possible, consider configuring your system to make Subversion

You can save the encrypted password. See the documentation for details.

You can set the option "store-plaintext-passwords" to "yes" or "no" in "/root/. subversion/servers ",

To avoid this warning again.

-----------------------------------------------------------------------

Save Unencrypted Password (yes/no )? Y

Enter 'yes' or 'no': yes

Obtain version 1.


Do not prompt yes/on every input.

Edit vim/root/. subversion/servers to find the downstream and remove # change on to yes. The above green section prompts store-plaintext-passwords = no.


2. The Service is working properly:

[Root @ localhostconf] # netstat-anpl | grepsvn

Tcp000.0.0.0: 255.00.0.0.0: * LISTEN318/svnserve

Bytes ---------------------------------------------------------------------------------------------------------------------

At this point, the SVN server configuration is complete.


Linuxsvn client Configuration

Check the installed version

# Check whether earlier versions of SVN are installed
[Root @ localhost/] # rpm-qasubversion

# If the old version is stored, uninstall the old version SVN
[Root @ localhostmodules] # yumremovesubversion

Install SVN

[Root @ localhostmodules] # yuminstallsubversion

Verify Installation

Check the installed SVN version information.
[Root @ localhostmodules] # svnserve -- version

Svnserve, version 1.6.11 (r934serve)
Compiled on Jun232012, 00:44:03

Copyright (C) 2000-2009CollabNet.
Subversion is open-source software. For more information, see http://subversion.tigris.org/site.
This product contains software developed by CollabNet (http://www.Collab.Net.

The backend (FS) module of the library is available in the following versions:

* Fs_base: the module can only operate BDB version libraries.
* Fs_fs: This module works with the text file (FSFS) version library.

CyrusSASL authentication is available.

SVN Client File Download

[Root @ localhost ~] # Mkdir/svn

[Root @ localhost ~] # Cd/svn/# store the files extracted from the svn service in this directory

[Root @ localhostsvn] # svncheckoutsvn: // 192.168.233.203/repo # svn server address

Enter the user name and password: hello/123


Note: You can use a user name and password for access:

Svnco -- usernamehello -- password123svn: // 192.168.233.203/repo


SVN version library update

Svnup/svn/repo

Upload files to the server

[Root @ localhost] # touch/svn/repo/test. php # all actions must be completed in the repo version library.

[Root @ localhost] # svnadd/svn/repo/test. php # upload the test. php file to the svn server.

Delete files on the server

[Root @ localhost] # svnrm/svn/repo/test. php -- force

View version Library Content

[Root @ localhost ~] # Svnlist/svn/repo/


Bytes ------------------------------------------------------------------------------------------------------------------------

At this point, the SVN client configuration is complete.



Create a version Library:
Terminal input: svnadmincreate [path]
This path can be a relative path. For example, if you enter svnadmincreatemyproject in the home/user/svn/directory, the version library will be created in the home/user/svn/directory, create a folder named myproject, which is the version library file.

Import files to the version Library:
Terminal input: svnimport [Source Path] [target version library path]-m [log information]
The source path can be a relative path. During the import, all files and folders under the source path will be recursively imported. The path of the target version library must be an absolute directory (I tried it anyway ), for example, the version library directory is home/user/svn/myproject /. Write file: // home/user/svn/myproject/
For example, import the current directory to the version library myproject:
Svnimport. file: // home/user/svn/myproject-m "Import file"

Export from the version Library:
After the import, the original file is not included in version management. If you want to obtain a file under version control, you need to export it from the version library.
Terminal input: svnco [version library path]
For example, export the files in the myproject Library to the current directory: svncofile: ///home/user/svn/myproject.


5. Install the svn client on Windows XP: TortoiseSVN (SVN client)

1. English version:

Http://tortoisesvn.net/downloads.html


2. Chinese version installation

After the download is complete, you can directly install it next. After the installation is complete, you need to restart the system to take effect (select the 32-bit 64-bit version ).,

After the Chinese character package is installed, the Chinese version option is displayed. Set it to the Chinese version as follows:

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.

Enter the svn Server IP address and version library to be connected. The output directory can be changed based on your preferences.

Enter the name and password of the user connecting to the server.

Check the folder

Move the file to the repo folder on windows for upload. Right-click the file to be uploaded and choose add.

Right-click again and choose submit.

After submission, you can check what operations can be performed on this file.

The Windowssvn client is over now. Let's explore the other functions. I will not repeat them again.

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.