SVN installation 2

Source: Internet
Author: User

1. Two files are required: httpd and subversion.
Httpd is a web server used to access subversion through the Web. httpd can be downloaded
Latest:
Httpd:
Http://httpd.apache.org/download.cgi? Preferred = http % 3A % 2f % 2fwww.apache.org % 2 fdist

Subversion:
Http://subversion.tigris.org/downloads/subversion-1.4.0.tar.gz

2. Create a user: svnroot
It is best not to involve the root user in SVN permission management and daily operation and maintenance, but some of the following installation and configuration
The operation still needs to be completed by the root user, because some operations can only be performed by the root user. Permission issues are important. I had a hard time having permissions.

3. Compile and install httpd (root user operation ):
// Decompress the apache2 installation package
# Tar xvzf
Httpd-2.2.2.tar.gz
// Enter the decompressed directory
# Cd httpd-2.2.2
// Configure Apache installation, the first two
Parameters must be added. You can also add other parameters as needed.
// Specify the following parameters. Where do you want to install Apache?
#./Configure
-- Enable-Dav -- enable-so -- prefix =/usr/local/apache2/
# Make
// Install
#
Make install
# Cd/usr/local/apache2/bin
// Start the apache service
#
./Apachectl start
// Open the browser http: // localhost/
For example
If there is a test page "It works! "The installation is successful.

4.
Install Subversion
// Decompress the Subversion installation package (perform the following operations as the root user)
# Tar xvzf
Subversion-1.3.1.tar.gz
// Enter the decompressed directory
# Cd subversion-1.3.1
// Configure
Subversion Installation
#./Configure -- With-apxs =/usr/local/apache2/bin/apxs
-- Prefix =/usr/local/Subversion
-- With-Apr =/usr/local/apache2
-- With-Apr-util =/usr/local/apache2 -- With-SSL -- With-zlib
-- Enable-maintainer-Mode
#
Make
// Install
# Make install
// Create the directory where the library file is located (the svnroot user performs the following operations)
#
Mkdir/home/svnroot/Repository
// Enter the bin directory of subversion
# Cd
/Usr/local/subversion/bin
// Create a repository "test"
#./Svnadmin create
/Home/svnroot/Repository/test
# Cd/home/svnroot/Repository/test
//
Check if there are more files. If yes, it indicates that the Subversion is successfully installed.
# Ls-l
# Cd
/Usr/local/subversion/bin
// This statement imports the files found in the path/home/user/import to
Go to the Subversion repository,
// The submitted revision is 1.
#./SVN import/home/user/import file: // home/svnroot/Repository/test
-M "comment"
// Do not allow others to have permission for this directory
# Chmod 700/home/svnroot/Repository

5. Modify the Apache configuration file
# Cd/usr/local/apadche2/bin
// Start Apache
#
./Apachect1 start
# Vi/usr/local/apache2/CONF/httpd. conf

// Add at the bottom
Loadmodule dav_module modules/mod_dav.so

Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule
Authz_svn_module modules/mod_authz_svn.so
<Location/SVN>

Dav SVN
Svnparentpath/home/svnroot/Repository // SVN parent directory

Authzsvnaccessfile/home/svnroot/Repository/authz. conf // permission configuration file

Authtype basic // set the connection type
Authname "subversion. zoneyump" // connection box prompt

Authuserfile/home/svnroot/Repository/AuthFile // user configuration file
Require
Valid-user // which authentication is used
</Location>

// AuthFile uses "htpasswd [-C]/home/svnroot/Repository/AuthFile Username
Password "to create
// "Require
Valid-user "tells Apache that all users in AuthFile can access Apache. Without it,
// Only the first user can access the new database

// Change your port number by the way. Otherwise, it may & your previous Apache port conflict

 

 

6. Restart Apache #./usr/local/apache2/bin/apachectl restart
// Open the browser to access http: // localhost/SVN/test/
, If something is displayed
It indicates the operation is successful.

7. permission management
1) Add users
# Htpasswd [-C]
/Home/svnroot/Repository/AuthFile wooin
// Use-C to create a new user file when setting the user for the first time. Enter
Enter the user password to add the user
# Htpasswd AuthFile username (Add a new user)

2) Permission assignment
# Vi/home/svnroot/Repository/authz. conf
[Test:/]
// This indicates the access permission under the root directory of the Repository Test
Wooin = RW // The test warehouse wooin user has read and write permissions

Bao = r // test repository Bao users have read permission
[Test2: //] // access permission under the root directory of the Test2 Repository

Wooin = r // The wooin user has only the read permission in the root directory of the Test2 repository.
Bao = // Bao user on
The root directory of the Test2 repository does not have any permissions.
[/] // This indicates that it is in the root directory of all warehouses
* = R
// This indicates that all users have the read permission.
# [Groups] // This indicates group settings
# Svn1-developers
= Wooin, Bao // indicates a member in a group
# Svn2-developers = wooin

# [Svn1:/]
# @ Svn1-developers
= RW // If the @ symbol is added to the front, it indicates that this is a group permission setting.

After this setting is complete. Restart Apache.
Http: // localhost/SVN/test

This URL is used to access the repository. Of course, restricted permissions must be valid to access the repository.

 

Note:

1. Apache process permissions: because all the operations transmitted with the repository are performed through the Apache process, even if you have set a lot of permissions for SVN users
The Apache process does not have the permission to access the repository or related files.
In the/usr/local/apache2/CONF/httpd. conf file, find the two lines in the file:
User daemon #
Change daemon to svnroot to run Apache processes as svnroot.
Group daemon

2.

Set some work to be done when SVN is started at the end of/etc/profile # start Apache server for SVN
/Usr/sbin/apachectl
Start
Export svn_editor = vi

3. The file operation permissions under/home/respository/svnroot are granted to svnroot.

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.