Build a Linux SVN server and a Linux SVN Server
1. One Ubuntu PC, preferably the latest stable Ubuntu version 2. Run the following command to install subversion:
sudo apt-get updatesudo apt-get install subversion
3. If the root path of the Code svn repository is/home/svnroot, run the following command to create a directory:
sudo mkdir /home/svnroot
4. Create a code repository. Assume that the repository name is example.
cd /home/svnrootsudo svnadmin create example
After this command is executed, a directory named example will be added under/home/svnroot, which is the example code repository.
5. Edit the access permission for the example Repository
Modify the three files in/home/svnroot/example/conf: authz passwd svnserve. conf
Where:
Passwd saves the user name and password
The User Group Definition and access permission definitions of various directories are saved in authz.
The configurations used in this code repository are saved in svnserve. conf (Do You Want To allow anonymous users? Specify the user name and password database ...)
Here is a typical configuration:
Passwd instance:
[users]xiaoming = 1111xiaowang = 2222xiaoli = 3333laowang = 4444shuangshuang = 5555dashi = 6666
Authz instance (admin can read and write all directories, dev can read and write branch, dev read-only trunk/tag ):
[aliases]# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average[groups]admin = xiaolidev = laowang,shuangshuang,dashi,xiaowang,xiaoming[/]@admin = rw@dev = r[/trunk]@admin = rw@dev = r[/tag]@admin = rw@dev = r[/branch]@admin = rw@dev = rw
Svnserve. conf instance (disable anonymous access and specify the user database and Authentication database ):
### This file controls the configuration of the svnserve daemon, if you### use it to allow access to this repository. (If you 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 = noneauth-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 (see below), this file will NOT be used.### Uncomment the line below to use the default password file.password-db = 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 is relative to the the### directory containing this file. If you don't specify an### authz-db, no path-based access control is done.### Uncomment the line below to use the default authorization file.authz-db = 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 First Repository[sasl]### This option specifies whether you want to use the Cyrus SASL### library for authentication. Default is false.### This section will be ignored if svnserve is not 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
6. Add the svn service as a system self-starting project
-Create svnd. sh with the following content:
#!/bin/bashsvnserve -d -r /home/svnroot
Put this file in/etc/init. d/svnd. sh
Function of this script: To start the svn service, external machines can access the svn server through various svn tools only after the service is started.
-Add executable permissions
sudo chmod a+x /etc/init.d/svnd.sh
-Edit rc. local
vim /etc/rc.local
Add/etc/init. d/svnd. sh before exit 0.
-Restart the server and run the following command:
ps -e | grep svnserve
Check whether the svn service is automatically started with the system from the command results.
Build an SVN server on linux
I have heard of this thing, but I have never encountered any environment to be built. So I cannot help the landlord.
If you have any other issues with the Linux Server redhat centos, shell programming, and linux system management, you can study and discuss them together!
Hope to help you with linux technology!
Build an SVN server on linux
I have heard of this thing, but I have never encountered any environment to be built. So I cannot help the landlord.
If you have any other issues with the Linux Server redhat centos, shell programming, and linux system management, you can study and discuss them together!
Hope to help you with linux technology!