Linux on the SVN environment to build __linux

Source: Internet
Author: User
Tags aliases mkdir svn iptables

In general, Linux is brought in the SVN environment.

See if SVN has installed

[14:50:28] [Root@vm60 ~]# Rpm-aq Subversion
[14:50:30]subversion-1.6.11-9.el6_4.x86_64

[14:52:01] [Root@vm60 ~]# Whereis SVN
[14:52:01]SVN:/usr/bin/svn/usr/share/man/man1/svn.1.gz


[14:55:59] [Root@vm60 ~]# Svnserve--version
[14:55:59]svnserve, Version 1.6.11 (r934486)
[14:55:59] Compiled APR 2 2013, 08:56:54


Create an SVN folder that holds code

[15:21:34] [Root@vm60 opt]# mkdir-p Svn/data
[15:21:53] [Root@vm60 opt]# mkdir-p svn/svnpasswd


Start Svnserve

[15:22:15] [Root@vm60 opt]# svnserve-d-R svn/data/

Start SVN command with svnserve-d-R installation path-D Svnserve.exe run in the background as a service program;-R indicates that the SVN directory is treated as the root directory.


See if success has started

[15:23:33] [Root@vm60 opt]# ps-ef|grep svn|grep-v grep
[15:23:33]root 24891 1 0 07:19? 00:00:00 svnserve-d-R svn/data/

[16:25:14] [Root@vm60 ~]# Netstat-lnt|grep 3690
[16:25:14]tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN


Create a project library

[15:27:03] [Root@vm60 opt]# svnadmin Create Svn/data/qualitymonitor



[15:27:13] [Root@vm60 ~]# cd/opt/svn/data/
[15:27:14] [Root@vm60 data]# LL
[15:27:14]total 4
[15:27:14]drwxr-xr-x 6 root 4096 Nov 07:24 qualitymonitor



[15:27:16] [Root@vm60 data]# CD qualitymonitor/
[15:27:17] [Root@vm60 qualitymonitor]# LL
[15:27:17]total 24
[15:27:17]drwxr-xr-x 2 root 4096 Nov 07:24 conf
[15:27:17]drwxr-sr-x 6 root 4096 Nov 07:24 db
[15:27:17]-r--r--r--1 root 2 Nov 07:24 format
[15:27:17]drwxr-xr-x 2 root 4096 Nov 07:24 hooks
[15:27:17]drwxr-xr-x 2 root 4096 Nov 07:24 locks
[15:27:17]-rw-r--r--1 root 229 Nov 07:24 README.txt



[15:27:42] [Root@vm60 qualitymonitor]# CD conf/
[15:27:42] [Root@vm60 conf]# LL
[15:27:42]total 12
[15:27:42]-rw-r--r--1 root 1080 Nov 07:24 Authz
[15:27:42]-rw-r--r--1 root 309 Nov 07:24 passwd
[15:27:42]-rw-r--r--1 root 2279 Nov 07:24 svnserve.conf


Edit configuration file

[15:31:27] [Root@vm60 conf]# VI svnserve.conf

Must be fixed, cannot have spaces

### This file controls the configuration of the Svnserve daemon, if you
### use it to allow access to this repository. (If only allow
### access through http:and/or file:urls, then this file is
### irrelevant.)


### Visit http://subversion.tigris.org/for more information.


[General]
### These options control access to the repository for unauthenticated
### and Authenticated users. Valid values are "write", "read",
### and "None". The sample settings below are the defaults.
Anon-access = None
auth-access = Write
### the PASSWORD-DB option controls the location of the password
### database file. Unless you specify a path starting with A/,
### the file ' s location is relative to the directory containing
### this configuration file.
### If SASL is enabled (= below), this file won't be used.
### uncomment the line below to use the default password file.
Password-db =/opt/svn/svnpasswd/passwd
### the AUTHZ-DB option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a/, the file ' s location was relative to the '
### directory containing this file. If you don ' t specify an
### authz-db, no path-based access control was done.
### uncomment the line below to use the default authorization file.
Authz-db =/opt/svn/svnpasswd/authz
### This option specifies the authentication realm of the repository.
### If Two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default Realm
### is repository ' s UUID.
# realm = My Repository


[SASL]
### This option specifies whether your want to use the Cyrus SASL
### Library for authentication. The Default is false.
### This section'll be ignored if Svnserve isn't built with Cyrus
### SASL support; To check, run ' Svnserve--version ' and look for a line
### reading ' Cyrus SASL authentication is available. '
# USE-SASL = True
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256



[15:45:55] [Root@vm60 conf]# CP Authz PASSWD/OPT/SVN/SVNPASSWD
[15:54:57] [Root@vm60 conf]# cd/opt/svn/svnpasswd/


Modify permissions, security

[15:46:04] [Root@vm60 svnpasswd]# chmod 700 *
[15:46:06] [Root@vm60 svnpasswd]# LL
[15:46:06]total 8
[15:46:06]-rwx------1 root 1080 Nov 07:43 Authz
[15:46:06]-rwx------1 root 309 Nov 07:43 passwd


Configure User name password

[15:46:45] [Root@vm60 svnpasswd]# VI passwd


### This file is a example password file for Svnserve.
### its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [Users].
### the name and password for each user follow.

Add user name password under users

[Users]
# Harry = Harryssecret
# sally = Sallyssecret


Liwen.xu=liwen.xu
Ting.chen=ting.chen
Erhuan.deng=erhuan.deng
Miaogen.zeng=miaogen.zeng


Configure Project user Rights

[15:50:07] [Root@vm60 svnpasswd]# VI Authz


### This file is a example authorization file for Svnserve.
### its format is identical to that of MOD_AUTHZ_SVN authorization
### files.
### as shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### the authorizations follow. An authorization line can refer to:
###-a single user,
###-a group of users defined in a special [groups] section,
###-an alias defined in a special [aliases] section,
###-All authenticated users, using the ' $authenticated ' token,
###-Only anonymous users, using the ' $anonymous ' token,
###-anyone, using the ' * ' wildcard.
###
### A match can be inverted by prefixing the rule with ' ~ '. Rules can
### Grant Read (' R ') access, read-write (' RW ') access, or no access
### ('').


[Aliases]
# Joe =/c=xz/st=dessert/l=snake City/o=snake oil, ltd./ou=research Institute/cn=joe Average

Set up user groups, a group can be multiple users, separated by commas

[Groups]
# harry_and_sally = harry,sally
# Harry_sally_and_joe = Harry,sally,&joe
Dev=liwen.xu,ting.chen,erhuan.deng,miaogen.zeng




# [/foo/bar]
# Harry = RW
# &joe = R
# * =


# [Repository:/baz/fuz]
# @harry_and_sally = RW
# * = R

Set Project user rights. The format must be written like this.

[qualitymonitor:/]
@dev =RW


Restart Svnserve

[15:57:43] [Root@vm60 opt]# Pkill Svnserve


[15:57:57] [Root@vm60 opt]# svnserve-d-R svn/data/

[16:25:14] [Root@vm60 ~]# Netstat-lnt|grep 3690
[16:25:14]tcp 0 0 0.0.0.0:3690 0.0.0.0:*


If the passwd and Authz files are modified without rebooting, the svnserve.conf must be restarted to take effect.


Add 3690 ports to the Linux firewall to pass.

First see if the firewall is open, if closed, do not configure the

Service Iptables Status


Edit/etc/sysconfig/iptables
-A input-p tcp-m tcp--dport 3690-j ACCEPT
Save in the front section
Reboot again:
Service Iptables Restart





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.