Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed method of installing and configuring SVN under ubuntu

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "detailed method of installing and configuring SVN under ubuntu". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and study and learn the "detailed method of installing and configuring SVN under ubuntu" together.

ubuntu installation and configuration SVN

Step 1: Install apache2 libapache2-svn subversion

The code is as follows:

sudo apt-get install apache2

sudo apt-get install subversion

sudo apt-get install libapache2-svn

After installation, follow the prompts

The code is as follows:

Run '/etc/init.d/apache2 restart' to activate new configuration!

Restart Apache2

Step 2: Create SVN library and project

The code is as follows:

sudo mkdir /home/svn //Create SVN library

sudo svnadmin create /home/svn/project //create a project

Step 3: Create a group and add members

sudo addgroup subversion //Create a group called subversion to own the directory where the repository is located

System prompt: Adding group "subversion" (GID 1001)...

Done.

sudo usermod -G subversion -a www-data //Add yourself and "www-data"(Apache user) to a group

See more /etc/group| grep subversion

Subversion:x:1001:www-data

Step 4: Modify project permissions

sudo chown -R root:subversion /home/svn/project

sudo chmod -R g+rws /home/svn/project //Gives group members permissions on all new files added to the repository

View permissions and user and group information for txn-current-lock files

ls -l /home/svn/myproject/db/txn-current-lock

System prompt: -rw-rwSr-- 1 root subversion 0 2011-01-25 17:47 /home/svn/project/db/txn-current-lock

Step 5: Access the library by command

sudo svn co file://lodalhost/home/svn/project//The first way to know the host name is to use

sudo svn co file:///home/svn/project//The second method, used when unsure of the host name, is file://, three slashes

System prompt: Remove version 0.

The version can be taken out, indicating that the SVN server is running normally. Try accessing it from webdav below.

Step 6: Configure Apache2

The requested URL/etc/apache/mods-available/dav_svn.conf was not found on this server.

sudo vim /etc/apache2/mods-available/dav_svn.conf

Add the following code:

================================

DAV svn

SVNPath /home/svn/myproject

AuthType Basic

AuthName "project subversion repository"

AuthUserFile /etc/subversion/passwd

Require valid-user

If user password authentication is required every time the user logs in, comment out two lines with

Restart apache2 after adding code

Step 7: Create the/etc/subversion/passwd file, which contains the details of the user authorization.

add users

sudo htpasswd -c /etc/subversion/passwd [user_name] //add user usage parameter "-c" for the first time, then add it later

Access file repository

svn co http://hostname/svn/project project --username [username]

OK! This time through the web page access to the repository, the following try to import the repository

Import a repository

Import the contents under/var/www/into the version number:

sudo svn import -m "First import" /var/wwwhttp://192.168.0.5/svn/project

========================================

System Notification:

Certification domain: myproject subject version repository

Password for root:

Certification domain: myproject subject version repository

User name: test

Password for "test":

Add/var/www/index.html

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

Attention! Your password for authentication domain:

myproject subversion repository

Only plain text can be saved on disk! If possible, consider configuring your system so that Subversion

Encrypted passwords can be saved. See documentation for details.

You can do this by setting the option "store-plaintext-passwords" to "yes" or "no" in "/home/icedot/.subversion/servers"

to avoid repeating this warning.

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

Save unencrypted passwords (yes/no)?

Please enter 'yes' or 'no': yes

Version 1 after submission.

==========================================

Finally in windows through TortoiseSVN and web page access, success.

==========================================

errors that have occurred in the course of experiments.

Error checking out version library:

sudo svn co http://192.168.0.5/home/svn/project

svn: method OPTIONS failed at "http://192.168.0.5/home/svn/myproject": 200 OK (http://192.168.0.5)

This error has been checked online for a long time, and there is nothing to learn from. The vague feeling may be that the user name and permissions are wrong, waiting for confirmation later.

sudo svn co file://localhost/home/svn/project

svn: Unable to open ra_local session for URL

svn: Unable to open repository "file://localhost/home/svn/projcet"

1. Install SVN

The code is as follows:

apt-get install subversion

2. Create svn repository

1). Create svn directory: mkdir /home/.svn(use hidden directory)

2). cd /home/.svn

3). mkdir astar

4). Create repository astar: svnadmin create /home/.svn/astar, after execution astar directory has directories and files created by svnadmin

5). mkdir test

6). Create test repository: svnadmin create /home/.svn/test, after execution test directory has directories and files created by svnadmin

3. Configuration and administration svn

1). The configuration file for each repository is under $repos/conf/, vi svnserve.conf, and the configuration items are under [general]:

anon-access: anonymous user permissions, can be read, write and none, default value read. Anonymous user access is not allowed: anon-access = none

auth-access: authenticates the user's permissions, which can be read, write, and none, with the default value of write.

password-db: path to password database, remove #

authz-db: path to authentication rulebase, remove #from front.

Note: these configuration items must be the top row, otherwise an error will be reported. You need to restart svn to make changes to the configuration.

2). Configure passwd file

This is the password file of each user, relatively simple, that is,"username = password," the use of plain code. As in allen= 11111

3). Configure authz file

1. [groups] section: For ease of management, you can put some users into a group, for example: owner=allen,ellen

2. The sections below groups represent authentication rules for a directory, such as the section [/] for authentication rules for the root directory. When setting authentication rules for a single user, one user has one line, for example:

[/]

allen=rw #allen permissions on root directory are rw

ellen=r #ellen permissions on root directory are r

If you use group, you need to add @ before the group name, such as

@owner=rw #The users in group owner are all rw, equivalent to the above two sentences

When booting from/home/.svn/astar,/is the astar directory. Set permissions as above with the astar directory as the root.

If you start from/home/.svn/, each repository root is still its own starting directory. You can set astar permissions as above or as follows:

[astar:/]

@owner=rw

The permissions for setting test are as follows:

[test:/]

@harry_and_sally = rw

In short, the root directory (/) of each warehouse is its own starting directory;[repos:/] this method is only suitable for multi-warehouse cases;[/] is suitable for single-warehouse and single-warehouse methods.

3. Permission cannot be set across warehouses.

4. Start and Stop svn

1). Start:

1. Start from astar directory, svnserve -d -r /home/.svn/astar, root directory (/) is astar, configuration of rules in authz uses section[/]. Access:

svn://192.168.0.87/

2. Start from the.svn directory, svnserve -d -r /home/.svn, root directory (/) is.svn, authz uses section[astar:/] for astar configuration, section[test:/] for test configuration. Access:

svn://192.18.0.87/astar

svn://192.18.0.87/test

If you want svn to boot, add the command to/etc/rc.local

2). Check if svn server is started (svn defaults to port 3690): netstat -an| grep 3690

3). Stop: killall svnserve

Thank you for reading, the above is the "ubuntu installation and configuration SVN detailed method" of the content, after the study of this article, I believe that we have a deeper understanding of ubuntu installation and configuration SVN detailed method of this problem, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report