Install the SVN + Apache service on Linux Server 5.5

Source: Internet
Author: User
Tags collabnet subversion gpg svn update version control system collabnet
Document directory
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Enterprise 5.5 install SVN + Apache service

Preface

(Abbreviation) is the successor of version management software that has emerged in recent years. Is a free/open-source version control system. That is to say, under management, files and directories can go beyond time and space. That is, you can recover data to an earlier version or check the data modification history. Because of this, many people regard the version control system as a magic "time machine ". Currently, most open-source software is used as code version management software.

Supported and, more is the installation.
The server has2Running Mode:Independent ServerAndWith.2Each method has its own advantages and disadvantages.
The stored version data also has2Method: And. Because data may be locked when the server is interrupted, it is safer to create a data version database.

Related platform software

+It is recommended to download the software installation package. The installation files on all platforms are downloaded for free on this site. Select the operating platform on which you want to install the configuration and download the corresponding installation file, install and configure.

Www.open.collab.net/cn/downloads/subversion/redhat.html

The Installation File I used is as follows:

Installation Process:

Installation is very easy. Just install the compiled rpm file!

First install. The installation instructions are as follows:

CollabNet Subversion RPMs are signed using our GPG key. As a one-time task,
Import the CollabNet GPG key using the command:

Sudo rpm -- import/path/to/RPM-GPG-KEY-csvn.asc

The CollabNet GPG key is available for download:
Http://www.collab.net/nonav/downloads/subversion/gpg-key/RPM-GPG-KEY-csvn.asc

Follow the instructions to perform the next installation. Otherwise, a message is displayed. Open the terminal and switch to the root account:

[Root @ localhost] # rpm -- import RPM-GPG-KEY-csvn.asc

After the signature file is installed, you can perform the following installation.

First install the client, then the server, and finally the extras. Install the client in sequence.

[Root @ localhost] # rpm-ivh CollabNetSubversion-client-1.6.9-1.i386.rpm
Preparing... ######################################## ### [100%]
1: collabNetSubversion-cli ##################################### ###### [100%]
[Root @ localhost] #

The client has been installed;

[Root @ localhost] # rpm-ivh CollabNetSubversion-server-1.6.9-1.i386.rpm
Preparing... ######################################## ### [100%]
1: collabNetSubversion-ser ##################################### ###### [100%]
[Root @ localhost] #

The server has been installed;

[Root @ localhost] # rpm-ivh CollabNetSubversion-extras-1.6.9-1.i386.rpm
Preparing... ######################################## ### [100%]
1: collabNetSubversion-ext ##################################### ###### [100%]
[Root @ localhost] #

The extras end is also successfully installed;

In this way, the three rpm installation files are successfully installed. In this case, the system automatically adds a csvn user/group.

[Root @ localhost] # more/etc/passwd
Csvn: x: 502: 501: CollabNet Subversion:/opt/CollabNet_Subversion:/bin/bash

[Root @ localhost] # more/etc/group
Csvn: x: 501:

SVN-related program directories are also created;

Subsequent Configuration:

Execute Configure-CollabNet-Subversion in the/opt/CollabNet_Subversion/bin directory and follow the prompts step by step to complete simple service configuration.

[Root @ localhost] #./Configure-CollabNet-Subversion

CollabNet Subversion Server is a free download of open-source Subversion,

Compiled and tested by CollabNet. For more information about CollabNet

Subversion, visit the CollabNet community at http://open.collab.net.

Wocould you like to configure the CollabNet Subversion Server now? [Yes] (Press ENTER)

Welcome to CollabNet Subversion Server setup.

You will now be asked some questions to configure CollabNet Subversion.

Defaults are given in square brackets. If a default is okay for you

Just hit [Enter] to continue.

This setup can configure either Apache or svnserve as Subversion

Server, for you. wocould you like to configure Apache as your

Subversion server now? [Yes] (Press ENTER)

Continuing with apache Subversion server configuration...

Specify the base directory for Subversion repositories: [/var/svn/repositories]/opt/SVNRepositories (here I changed the SVN repository storage path without using the default path .)

Non-existing base path, Let me create and continue [yes] (Press ENTER)

Base path created.

Wocould you like to create a new Subversion repository? [Yes] (Press ENTER)

What shocould be your new Subversion repository name? DEOM (Here we create a Test Library named DEMO)

New repository created.

Wocould you like to initialize the repository with trunk/branches/tags folders? [No] (Press ENTER)

Done.

Wocould you like to create another Subversion repository? [Yes] (Press ENTER)

What shocould be your new Subversion repository name? Svntest (create a library named svntest)

New repository created.

Wocould you like to initialize the repository with trunk/branches/tags folders? [No] (Press ENTER) (do not import initial data temporarily)

Done.

Wocould you like to create another Subversion repository? [Yes] no (two test libraries have been created and no longer created .)

Wocould you like to give the name and port that the server uses to identify itself? [Yes]

Registered DNS name or IP address: 192.168.168.159 (here IP refers to the "IP" configuration of apache services .)

Server port number: 18080 (apache service port number)

Allow anonymous read access? [No] (Press ENTER)

0 users currently have access to this repository:

Wocould you like to create a new Subversion account? [Yes] (Press ENTER)

Account username

(To re-create or delete a Subversion account, enter an existing username): svnadmin (create a SVN account)

Account password: (password)

Retype account password: (repeated password)

Adding password for user svnadmin

Account created

Wocould you like to create another user account? [Yes] no (no need to create another user now)

Wocould you like to configure ViewVC? [Yes] (whether to enable VierVC, press Enter)

Stopping CollabNet Subversion: httpd (no pid file) not running

Done

Starting CollabNet Subversion: done

(At this time,+The service is successfully configured. The last prompt is as follows :)

Congratulations! You have successfully configured the CollabNet

Subversion server.

You can access your repositories at the following URL:

Http: // 192.168.168.159: 18080/svn/YOUR-REPOS-NAME

Http: // 192.168.168.159: 18080/viewvc/YOUR-REPOS-NAME

Finally, check the Configuration:

[Root @ localhost] # ps-ef | grep httpd
Root 2569 1 0 18:16? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 2588 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 2595 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 2596 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 2597 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 2599 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 2600 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 3809 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 3813 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 3814 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 3836 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Csvn 3839 2569 0? 00:00:00/opt/CollabNet_Subversion/bin/httpd-D csvn_installed-D viewvc_installed-k start
Root 4696 4113 0 00:00:00 pts/1 grep httpd

Access the SVN service in a browser;

Http:/// 192.168.168.159: 18080/svn/DEMO

: Address Bar on the browser!

Http: // 192.168.168.159: 18080/viewvc

Summary:

Here,+The service is built. SVN is a good version control software. Enjoy the unlimited fun it brings!

 

 

 

 

 

1,Run the file checkout to the local directory.

Svn checkoutPath (path is the directory on the server)
Example: svn checkout svn: // 192.168.168.159: 18080/pro/domain
Abbreviation: svn co

2,Add a new file to the version Library

Svn AddFile
Example: svn add test. php (add test. php)
Svn add *. php (add all php files in the current directory)

3,Submit the modified file to the version library.

Svn commit-M "LogMessage" [-N] [-- no-unlock] PATH (if the lock is retained, use the -- no-unlock switch)
For example, svn commit-m "add test file for my test" test. php
Abbreviation: svn ci

4,Lock/unlock

Svn lock-M "LockMessage" [-- force] PATH
For example, svn lock-m "lock test file" test. php
Svn unlockPATH

5,Update to a specific version

Svn update-rM path
For example:
If there is no directory after svn update, all files in the current directory and sub-directories are updated to the latest version by default.
Svn update-r 200 test. php (restore the file test. php In the version library to version 200)
Svn update test. php (updated for version library synchronization. If an expiration prompt is prompted during submission, it is because Conflict. update the file first.And then clear Svn resolved, And then submit commit)
Abbreviation: svn up

6,View the file or directory status

1) Svn statusPath (the State of the files and subdirectories under the directory, the normal state is not displayed)
【? : Not under svn control; M: The content is modified; C: A conflict occurs; A: It is scheduled to be added to the version Library; K: it is locked]
2) Svn status-vPath (display file and subdirectory status)
The first column remains the same, the second column displays the working version number, and the third and fourth columns show the last modified version number and modifier.
Note: svn status, svn diff, and svn revert commands can be executed without a network, because svn is locally deployed. svn retains the original copy of the local version.
Abbreviation: svn st

7,Delete an object

Svn deletePath-m "delete test fle"
Example: svn delete svn: // 192.168.168.159: 18080/pro/domain/test. php-m "delete test file"
Or directly delete svn test. php and then svn ci-m 'delete test file'. We recommend that you use this
Abbreviation: svn (del, remove, rm)

8,View logs

Svn logPath
For example, svn log test. php displays all the modification records of this file and changes to its version number.

9,View File details

Svn infoPath
Example: svn info test. php

10,Comparison

Svn diffPath (compare the modified file with the basic version)
Example: svn diff test. php
Svn diff-R m: n path (differences between version m and version n)
Example: svn diff-r 200:201 test. php
Abbreviation: svn di

11,Merge the differences between the two versions into the current file

Svn merge-rM: n path
For example, svn merge-r test. php (merge the differences between version 200 and version 205 to the current file, but there are usually conflicts. You need to handle them)

12,SVN help

Svn help
Svn help ci

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

The above are common commands. Below are a few

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

13,List of files and contents in the version Library

Svn listPath
Displays all files and directories in the path directory that belong to the version library.
Abbreviation: svn ls

14,Create a new directory under Version Control

Svn mkdir: Create a new directory under version control.
Usage: 1. mkdir PATH...
2. mkdir URL...
Create a version control directory.
1. Each directory specified by the working copy PATH will be created on the local end and added to the new
Scheduling to wait for the next submission.
2. Each directory specified with a URL is created by submitting it to the repository immediately.
In both cases, all the intermediate directories must exist in advance.

15,Restore local modification

Svn revert: Restore the original unchanged working copy file (recover most local modifications ). Revert:
Usage: revert PATH...
Note: The sub-commands do not access the network and will release the conflict. But it won't be restored.
Deleted directory

16,Code library URL change

Svn switch (sw ):Update the working copy to different URLs.
Usage: 1. switch URL [PATH]
2. switch -- relocate from to [PATH...]

1. update your work copy and map it to a new URL. The behavior is similar to "svn update" and
Merge files on the server with local files. This maps the work copy to a branch or tag in the same warehouse.
Method.
2. Rewrite the URL metadata of the working copy to reflect the changes on the simple URL. When the root URL of the Repository changes
(For example, the solution name or host name change), but the working copy is still mapped to the same directory in the same repository.
This command updates the correspondence between the working copy and the warehouse.

17,Resolve Conflicts

Svn resolved:Remove the "Conflict" Status of the directory or file of the working copy.
Usage: resolved PATH...
Note: subcommands do not follow the syntax to resolve conflicts or remove conflicting tags. They only remove conflicting tags.
Related files, and then allow the PATH to be submitted again.

18,Output the content of the specified file or URL.

Svn catIf the target [@ version]... is specified, it is searched from the specified version.
Svn cat-r PREV filename> filename (PREV is the previous version, you can also write the specific version, so the output result can be submitted) From: http://hi.baidu.com/zxf5678766/blog/item/4617d3eb6785fe5379f05594.html

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.