About SVN installation (LINUX+NGINX+SVN)

Source: Internet
Author: User

Today installs the SVN originally thought very simple thing to go to the pit to get a half day, unifies several online documents to put on the use of oneself to serve. If there is insufficient and wrong place everyone to help to advise AH.

1. Installation

Install SVN

Before installing, we'll check if there's SVN.

Command:svn--version (view SVN version information)

-bash:svn:command not found

Installation not Started

Two methods
# Yum Install subversion

# Apt-get Install Subversion

Self-selection

I'm using Yum.

After installation svn--version

And then it's creating the SVN repository.

I am this path/opt/svn/project, can see personal habits

#mkdir/opt/svn/project

And then we're creating the warehouse.
#Svnadmin Create/opt/svn/project

2. Configuration

The above operation is very simple, a few commands will be done, the following operation is not difficult.


Enter the/opt/svn/project directory ( where the project directory is not the Web directory of the Web site, and the warehouse name is Project).

will see CONF, hooks, DB and other directories, we will use the Conf (configuration directory) hooks (set the hook, will be discussed later)
Into the Conf directory, there are several files (Authz, passwd, svnserve.conf)

Where Authz is the permission control, you can set which users can access which directories, passwd is to set the user and password, Svnserve is to set up SVN-related operations.

Configure svnserve.conf First
# Vim Svnserve.conf
Modify (Remove the previous # number, configure the following values, modify the five lines of code)
Anon-access = none # makes non-authorized users inaccessible
auth-access = Write # Enables authorized users to have write permissions
password-db = password
authz-db = authz # access Control file
Realm =/opt/svn/repos (realm = project) # Authentication namespace, Subversion is displayed in the authentication prompt and as a keyword for credential caching.
The default configuration is used. all of the above statements must be shelf written, the left cannot be blank, or an error will occur.

Adding users to the passwd file
# vim passwd
[Users]
admin = 123456

Here a user is set up, depending on the situation can be set freely.

Adding groups and permissions in Authz
# Vim Authz

[Groups]
group1 = Admin,dazeair #group1组里的成员
Group2 = User1,user2

[/] #配置根目录的权限
admin =RW #admin用户对 [/] directory permissions: R Read, W write
@group1 = RW #@ represents group, group1 group has read and write permissions
@group2 = R #group2组只有r读权限
* = #这里表示其他用户无任何权限

Permissions for the User1 folder under [Www:/user1] #配置根目录 (www directory)
User1 = RW

As explained here, four users were added earlier, two groups were divided, the root directory group1 had read and write permissions, and group2 had only R permissions.
User1 under the root directory (www directory)

Well, with the above configuration, your svn will be OK.

3. Connection

Start Svnserve
# svnserve-d-r/data/svn/project

You can also use the--listen-port parameter to specify a port (default port 3690) to start multiple warehouses

Normally the problem does not occur, such as the appearance please check the configuration file just now

If error:

Svnserve:can ' t bind server socket:address already in use

Tangled Up!
Workaround:

# Killall Svnserve
# svnserve-d-r/opt/svn/repos started successfully.

Or
# svnserve-d-r/mnt/westos--listen-port 3691

So that the same server can run multiple Svnserver

OK, after the successful launch, you can use it.

It is recommended to use TORTOISESVN on window, with the connection address: Svn://your Server addr (if you need to add ports to the specified port: port number)

This piece of attention must be in your test or project directory:

After the connection can upload the local files, effectively manage your code.

4. Create more than one repository

To add a new repository under the/SVN directory, create the appropriate directory directly, then set it as the repository, and then configure it,
No need to rerun svnserve-d-r/opt/svn/project,

There is no need to apply this command to the directory you created in the/SVN directory,

For example, in the/SVN directory to create a new Project2 resource library, the command is as follows:

# mkdir-p/opt/svn/project2

# svnadmin Create/opt/svn/project2

... (Three file configurations)

(No need to run svnserve-d-r/opt/svn/project2)

Another piece is to manage your online code, which is then edited after this piece of research. (There are follow-up ... )

About SVN installation (LINUX+NGINX+SVN)

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.