Setup SVN server on Ubuntu 14.04
来源:互联网 发布:淘宝返利网官网 编辑:程序博客网 时间:2024/06/09 20:15
https://www.howtoforge.com/how-to-install-and-use-svn-with-apache-dav_svn-on-ubuntu-14.04
http://www.if-not-true-then-false.com/2010/svn-subversion-access-control-with-apache-and-mod-authz-svn/
1.1 SVN-An Overview
Subversion is a popular open source version control system that enables users to record the history of source files and documents, and manage files and directories over a period of time. It is akin to a tree of files being placed into a central repository on the lines of a regular file server, barring that each modification made to these files and directories is always remembered.
1.2 Step-by-Step Guide on the Installation and Use of SVN on Ubuntu 14.04
This tutorial explains the process of installing and using SVN on Ubuntu 14.04 as per steps outlined below.
1.2.1 Step 1: Ensuring Up-to-Date Installed Packages
At the outset, you must ensure that all the packages installed on your system are updated. The following command shall help you do that:sudo apt-get update
1.2.2 Step 2: Downloading the Subversion, Subversion Tools and Libapache2 packages
To run a Subversion (SVN) server, you need all the requisite packages, and you need to key in the following command for the same:sudo apt-get install subversion subversion-tools libapache2-svn
You are now geared up to for the next step.1.2.3 Step 3: Creating Subversion (SVN) Directory
Here, you are required to create a directory where all the repositories may be housed. It is advisable to choose a directory that is easily accessible to your the managed backup service for obvious reasons. Please key in the following command to do the same:sudo mkdir /home/svn
This brings you to the end of this step, and you may move on to the next one, as explained below.
1.2.4 Step 4: Creating a Test Repository
As part of this step, users need to first create a new folder to create the test project, and subsequently create a repository for the same. The following command shall help you do that:sudo mkdir ~/test
sudo svnadmin create /home/svn/test -m 'initial project structure'
1.2.5 Step 5: Adding Files into the Test Project
Once you have created the repository, please use the following command to add files into the test project:cd ~/test
mkdir trunk tags branches
sudo svn import ~/test file:///home/svn/test -m 'Initial project directories'
The above command lets you add and also commit the new directories into the repository, all in one go. Further, for Apache to access the SVN repositories, the directory thus created (/home/svn directory) must necessarily be owned by the same user and also group that Apache runs as. More often than not, in Ubuntu, it happens to be www-data. In order to change the directory owner, please use the following command:sudo chown -R www-data:www-data /home/svn
The above command shall enable you to change the owner of the directory, and you may subsequently move on to the next step.
1.2.6 Step 6: Configuration of Apache
Using the following command, you would be able to enable the dav_svn Apache module:sudo a2enmod dav_svn
After having enabled this, you would be required to modify the Apache configuration file (as follows):sudo nano /etc/apache2/apache2.conf
Right at the bottom of the file, please add the following lines, before saving the file by hitting Ctrl+X.DAV svn SVNParentPath /home/svnAfter having saved this, you must restart the Apache service so as to implement the changes, by using the following command:
sudo service apache2 restart
http://127.0.0.1/svn/test.
Here, you would be able to view all the three directories, though they would all be empty. You may now proceed to the next step.
1.2.7 Step 7: Securing the SVN Repositories
Before the users start committing the files to the test repository, they must ensure that only authorized users are able to view it. The current settings, however, would allow unauthorized viewing, and checking out of the repository and its contents, in addition to checkout and committing of files by just about anyone. To secure the repositories, you must supply a username and a password before you begin to view the repository/ perform any action on the same. To execute this, you must reopen apache2.conf, and replace the SVN Location information with the following:DAV svn SVNParentPath /home/svn AuthType Basic AuthName "My SVN Repositories" AuthUserFile /etc/svn-auth Require valid-userFurther, you must create a password file by using the following command:
htpasswd -cm /etc/svn-auth disney
Upon keying in the above command, you would be prompted to enter and confirm your password, and subsequently your details would be saved. Next, the Apache service must be restarted, and subsequently, the user would need to authenticate themselves before going about viewing the repositories.
1.2.8 Step 8: Checking Out the Repository and Committing Files
For checking out the files contained within the repository into a new directory (let us call it Test2) within the home directory, you first need to create the new directory before you may issue the checkout command (as explained below):cd ~
mkdir test2
svn checkout http://127.0.0.1/svn/test/trunk test2
svn add index.php
svn add *
Once all the required files have been added, these may be committed using svn commit -m 'commit message' , and further, the server may be updated using the SVN up command. This brings you to the end of the process!
Setup SVN (Subversion) Access Control with Apache and mod_authz_svn
1. Change root user
2. Add SVN (Subversion) users
Use following command:
Note: Use exactly same file and path name as used on subversion.conf file. This example use /etc/svn-auth-users file.
3. Create SVN Access Control file
On this guide, I use following /etc/svn-access-control file.
Add following type content to file:
4. Add AuthzSVNAccessFile to subversion server config
Previously created /etc/httpd/conf.d/subversion.conf file:
Add AuthzSVNAccessFile row to config:
Finally /etc/httpd/conf.d/subversion.conf file should look something like following:
5. Restart Apache Web Server
- Setup SVN server on Ubuntu 14.04
- Quick Subversion (SVN) Server Setup on Ubuntu Server 12.04
- Setup SVN environment on Ubuntu 14.04
- ubuntu svn server setup
- ubuntu svn server setup
- setup telnet server on Ubuntu
- setup tftp server on ubuntu
- Setup FTP Server on Ubuntu
- Setup SSH and SVN on Windows Server
- Initial Server Setup with Ubuntu 14.04 on Aliyun
- Setup GIT server on ubuntu 9.04
- Setup Syslog with LogAnalyzer on Ubuntu Server
- [pm] How to setup svn server on windows
- Setup Apache2+Php5+Mysql+Cakephp on Ubuntu Server 10.04
- Using pulseaudio to setup sound server on Ubuntu
- using FFMPEG to setup HLS server on Ubuntu
- Setup Your Own Shadowsocks Server On Debian, Ubuntu, CentOS
- Setup Nginx-RTMP on Ubuntu 14.04
- unity 控制旋转的方法
- ubuntu 16.04 LTS 下Robomongo 无法输入中文的问题
- linux ERROR c.a.d.s.DruidDataSourceStatManager - unregister mbean error javax.management.InstanceNo
- C语言入门(十六)预处理过程
- [BZOJ4552][JZOJ4605]【TJOI&HEOI2016】D1T2 排序
- Setup SVN server on Ubuntu 14.04
- find 查找文件命令
- svchost.exe占用内存过高
- python的多线程
- Netty权威指南读书笔记
- leetcode_c++:哈希:Bulls and Cows(299)
- Http请求中Content-Type讲解以及在Spring MVC中的应用
- CSS实现会发光的输入框input
- SecureCRT 7.3.4破解版(含注册机)