Ubuntu14.04 Server apache2+subversion Environment setup

Source: Internet
Author: User

Since the work, the discovery of the previous code development is too casual, so after less than two years of work accumulated, intends to develop their own software in the process of good management of their own projects. So plan to build their own Project Server, built once last year, but because there is no record, now need to come again, many steps to forget, at the same time encountered some new problems, collect a lot of information on the Internet, now step by step to record the process of building, are their own verification OK, need to reference reference.

Preparation of an installation environment

1. Install the following user packs:

$ sudo apt-get install subversion apache2 LIBAPACHE-SVN

(Note: If LIBAPACHE-SVN is not installed, the DAV SVN error will occur when configuring apache2, prompting for no DAV module)

After completing the above installation, you can directly access the Apache home page, enter in the browser address: HTTP//Server ip/, you will see the "It Works" interface, indicating that the installation is normal.

Two configuration svn

1. Create a version library

$sudo MKDIR/HOME/SVN

$sudo chmod 770/HOME/SVN

$sudo Chown LXM:SUBVERSION–R/HOME/SVN

$sudo Chmod–r G+RWS/HOME/SVN

$svnadmin Create/home/svn/repos

You can see all the folders and configuration files for the SVN repository in the/home/svn/repos directory:

Create Subversion user groups and add Apache running user Www-data and their users to the Subversion user group

$sudo AddGroup Subversion

$sudo usermod–g subversion–a Www-data LXM

Next, import the project file:

Enter the root directory of your project source file, such as my,/home/lxm/test

To import a project to the repository:

$SVN import/home/lxm/test file:///home/svn/repos/test–m "inital import"

2. Configure permissions Access and more

1) Add SVN user

$HTPASSWD-C/home/svn/repos/conf/passwd LXM//Then you will be prompted to enter the password, of course, the first time to create the SVN user, need to pass the parameter-C, and then the second time to create SVN users do not need, here to pay attention.

(optional) $htpasswd/home/svn/repos/conf/passwd test2//Create a second SVN user

At this point, see the/repos/conf directory of the passwd file into encrypted content

2) User Rights configuration

Because I am configured for my own use, the permissions are configured for my own access:

$ vim/home/svn/repos/authz

Code [group]admin = Admindevelop = lxm[/] @admin = Rw@develop = RW

$vim/home/svn/repos/svnserve.conf

Remove the # before the following code (note that there is no space in front of the code)

Auth-access = Write setting has permission for user permissions

PASSWORD-DB = passwd Specifies that a file is found for the user name and password so that the setting is passwd in this directory

AUTHZ-DB = Authz Set the individual user specific permissions to the file, so that the setting is the directory Authz

Three APECH2 configuration

$sudo vim/etc/apache2/mods-enabled/dav_svn.conf

Modify the following content:

Code <Location/svn>    DAV svn    svnpath/home/svn/repos    authzsvnaccessfile/home/svn/repos/conf/authz    authtype Basic    AuthName "Subversion Repository"    authuserfile/home/svn/repos/conf/passwd    

Note: This profile is to tell Apache about SVN's access path already associated with the configuration file, here note the root of F access

To restart the Apache server:

$sudo/etc/init.d/apache2 Restart

Four functional tests

To this, all configuration is complete, step by step verification below:

1. Apache Access Verification

In the browser address bar, enter:/HTTP Server ip/svn/

You will see access to the SVN version of the root directory, below you import the project folder, indicating that the Apache configuration is complete and functional

2. SVN verification

Export the SVN test on your own PC or other PC, provided the other PCs have access to the server

I install the TORTOISESVN client under Windows, export the SVN version of the Repository is OK, in the export address is filled with://server ip/svn/, need to fill in the account and password, that is, the previously added account and password.

After the export, modify a file in the project, check the submission there is no problem, I tested everything OK.

Ubuntu14.04 Server apache2+subversion Environment setup

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.