[Experience] source code management = Ubuntu + Apache + SVN

Source: Internet
Author: User
Tags builtin

Recently, my company's Windows server was poisoned. My colleague decided to switch to Linux. I heard that I used Linux and was idle, so I was pulled to install the server.

In the past, the svn server in the lab was configured with the boss. This time, I had to put my head on my head.

 

Google found the following article http://writeblog.csdn.net/PostEditPlain.aspx ):

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

1. Install the apache2.2 server (skip this step if you have installed it)

# Sudo apt-Get install apache2

# Sudo apt-Get install apache2-common

# Sudo apt-Get install apache2-mpm-prefork

# Sudo apt-Get install apache2-utils

# Sudo apt-Get install libapache2-svn

# Sudo apt-Get install libapache2-mod-auth-pam (optional, for Pam)

# Sudo apt-Get install libapache2-mod-auth-sys-group (optional, for Pam)

# Sudo apt-Get install Subversion

# Sudo apt-Get install subversion-Tools
Ii. SVN Configuration

1. Create a version repository for SVN (I will name my repository SVN and project name myproject my username Shi tokyo2006)
# Sudo mkdir/home/SVN
# Sudo mkdir/home/SVN/myproject
2. Create a user group to own the directory where the file warehouse is located (if you do not want to assign permissions through the group, you can also assign permissions by using the user alone)
# Sudo VI/etc/group
# Cat/etc/group | grep subversion Subversion: X: 1001: www-data, tokyo2006

Create Group Permissions

#/Home/SVN # sudo chown-r root: Subversion myproject

#/Home/SVN # sudo chmod-r g + RWS myproject
Create permissions for users separately
# Sudo chown-r www-data: www-data/home/SVN/myproject
Create a file warehouse
# Sudo svnadmin create/home/SVN/myproject
3. Apache configuration
# Sudo gedit/etc/apache2/mod-available/dav_svn.conf
Add the following content to the file:
<Location/SVN/myproject>
Dav SVN
Svnpath/home/SVN/myproject
Authtype basic
Authname "myproject subversion repository"
Authuserfile/etc/subversion/passwd
<Limitaskt get PROPFIND Options Report> (if you want to enter a password for each login, please remove this)
Require valid-user
</Limit10000t>
</Location>
After adding the preceding content, save and exit, and then restart Apache
# Sudo/etc/init. d/apache2 restart
Next, create the/etc/subversion/passwd file, which contains detailed information about user authorization.
# Sudo htpasswd-C/etc/subversion/passwd user name to be created
It will prompt you to enter the password. When you enter the password, the user will be created.
Enter http: // localhost/SVN/myproject in the browser to view your version.
We will submit a file for testing. We will submit a file in/home/tokyo2006/truck and use the following command
# Svn-import-m "Operation comments"/home/tokyo2006/truck http: // localhost/SVN/myproject
Check the browser to see if it turns into version 1. Now, let's go to checkout.
# SVN checkout http: // localhost/SVN/myproject/home/tokyo2006/test
Check if there is any file in the test folder?
That's all. Note mark

I found a more detailed Mrak http://www.ibm.com/developerworks/cn/java/j-lo-apache-subversion/ online

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

 

The above steps are clear, but the following three points are worth mentioning:Note::

1. When creating a group and adding a group to the user, You need to log on to the shell again to make the group take effect. Thanks to the prompts from the users of the shuimu community linuxapp version.

 

2. after a new version library is created, the permission denied error occurs during code import using the svn import command, in this case, The sudo chmod-r o + WXR must be added to the sudo chmod-r o + WXR directory. This may be insecure, but no solution has been found.

 

3. for Ubuntu, apache2-common and apache2-utils were renamed and don't need to be installed separately; libapache2-mod-auth-pam and libapache2-mod-auth-sys-group these two packages are not found in the new IDE source.

4. Generally, you must use SVN to manage multiple projects. Therefore, add the following two lines to the configuration file:

Svnlistparentpath on # access the parent directory

Svnparent/SVN # parent directory pointing to location

Note that the configuration files on Windows and UNIX platforms are different: Windows configuration files: Apache/CONF/httpd. conf Unix/Linux configuration files:/etc/apache2/mod-available/dav_svn.conf
========================================================== ==========
Finally, I will show you my configuration file:

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

Apache/CONF/httpd. conf in Windows:

<Ifmodule ssl_module>

Sslrandomseed startup builtin

Sslrandomseed connect builtin

</Ifmodule>

# Http: // localhost: 8086/SVN/

<Location/SVN/>

Dav SVN

Svnlistparentpath on

Svnparentpath E:/apache_svn/_ svn_root

Authname "Pam's SVN"

# Basic Verification Mode

Authtype basic

Authuserfile E:/apache_svn/apache2.2/CONF/SVN-passwd

Authzsvnaccessfile E:/apache_svn/apache2.2/CONF/SVN-Access

Require valid-user

</Location>

 

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

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

In Linux,/etc/apache2/mod-available/dav_svn.conf:

<Location/SVN/>

Dav SVN

Svnlistparentpath on

Svnparentpath/SVN

Authtype basic

# Satisfy any

Require valid-user

# Require valid-group

Options indexes Multiviews

Authname "Pam subversion repository"

Authuserfile/etc/subversion/passwd

Authzsvnaccessfile/etc/apache2/dav_svn.authz

# Require valid-user

# Satisfy any

# </Limit10000t>

</Location>

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








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.