Build Svn+apache Server on Ubuntu

Source: Internet
Author: User
Tags tortoisesvn

This trial of Linux distribution is Ubuntu 12.04.5 LTS

[Email protected]:~$ Lsb_release-ano LSB modules is available. Distributor ID:UbuntuDescription:Ubuntu 12.04.5 Ltsrelease:12.04codename:precise


Environments that need to be installed:

Apache2

Subversion

Libapache2-svn


1. Install SVN

[Email protected]:~$ sudo apt-get install subversion


2. Create a warehouse

[Email protected]:~$ sudo mkdir/srv/svn[email protected]:~$ cd/srv/svn[email protected]:/srv/svn$ sudo svnadmin create r Epos[email protected]:/srv/svn$ sudo tree-l 2.└──repos├──conf├──dav├──db├──format├──hooks├─ ─locks└──readme.txt6 directories, 2 files


3. Modify the configuration file

[email protected]:/srv/svn$ cd repos/conf/[email protected]:/srv/svn/repos/conf$  lsauthz  passwd  svnserve.conf[email protected]:/srv/svn/repos/conf$ sudo  vim svnserve.conf [general]                                      anon-access = none                             #  Anonymous user Rights change to noneauth-access = writepassword-db = passwdauthz-db =  authzrealm = My First Repository[email protected]:/srv/svn/repos/conf$  sudo vim passwd[users]admin = admin                                 #   Storing accounts and passwords in clear text [email protected]:/srv/svn/repos/conf$ sudo vim authz[groups]                                                    admin = admin                                  #  Add the Admin user to the admin group [/] @ admin = rw                                   The permissions for the  # admin group are read-write * = r                                          #  Other permissions are read-only


4. Testing

[Email protected]:/srv/svn/repos/conf$ sudo svnserve-d-r/srv/svn[email protected]:/srv/svn/repos/conf$ sudo netstat- ANTP | grep svn tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 13900/svnserve

Discovery 3690 Port is started.


-D: Run as Daemon

-r: Indicates the directory where the repository resides


Test by TortoiseSVN view and upload files

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/88/88/wKioL1f7Rn6BoAIzAACSQC0VUPg444.png "title=" Qq20161010154224.png "alt=" Wkiol1f7rn6boaizaacsqc0vupg444.png "/>


5. Installation of Apache2 and LIBAPACHE2-SVN

[Email protected]:~$ sudo apt-get install apache2 libapache2-svn


6, Configuration Apache2

[Email protected]:~$ cd/etc/apache2[email protected]:/etc/apache2$ lsapache2.conf conf.d httpd.conf Mods-availa ble ports.conf sites-enabled apache_ssl_pass.sh envvars Magic mods-enabled sites-available


7. Permission Modification

[Email protected]:/etc/apache2$ sudo useradd svnuser[email protected]:/etc/apache2$ sudo groupadd subversion[email protected]:/etc/apache2$ sudo groupadd svnuser subversion[email protected]:/etc/apache2$ sudo chown-r root:subversion/ Srv/svn[email protected]:/etc/apache2$ sudo chown-r www-data.www-data/src/svn


8. Modify the configuration file

Comment out all dav_svn.load and dav_svn.conf in mods-enabled, overwriting a new configuration file

[Email protected]:/etc/apache2$ sudo vim conf.d/subversion.conf# import module LoadModule dav_svn_module/usr/lib/apache2/    Modules/mod_dav_svn.soloadmodule authz_svn_module/usr/lib/apache2/modules/mod_authz_svn.so<location/svn/> DAV svn svnparentpath/srv/svn svnlistparentpath on authtype Basic authname ' svn authentication ' Authuserfi LE/ETC/APACHE2/SVN.PASSWD Authzsvnaccessfile/etc/apache2/svn.authz Require valid-user</location>


9. Generate authentication and key files

# Generate key file [email protected]:/etc/apache2$ sudo htpasswd-c-M svn.passwd Admin # first create plus-c[email protected]:/etc/apache2 $ tail svn.passwd admin: $apr 1$zaa6soa3$8zz5aapep9wan/kajn4rw1# generate config file [email protected]:/etc/apache2$ sudo vim Svn.authz[groups] admin = admin[/] @admin = rw* = r[repos:/] @admin = rw* = R


10. Restart Apache and SVN

[Email protected]:/etc/apache2$ sudo pkill svnserve[email protected]:/etc/apache2$ sudo svnserve-d-r/srv/svn[email Pro tected]:/etc/apache2$ sudo/etc/init.d/apache2 Restart


11, through the TORTOISESVN test

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/88/8D/wKiom1f7TUrzg5lOAACdlM-lqWU733.png "title=" Qq20161010161136.png "alt=" Wkiom1f7turzg5loaacdlm-lqwu733.png "/>


Build Svn+apache Server on Ubuntu

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.