参考网站:

http://www.thinksaas.cn/group/topic/335434/

http://blog.sina.com.cn/s/blog_3eba8f1c0100dqk1.html

http://www.linuxidc.com/Linux/2015-05/117735.htm

1.安装软件

apt-get install subversion

apt-get install apache2

apt-get install libapache2-svn

2.创建SVN库

mkdir /home/svn

最好使用root用户,否则其他的用户会引发一些权限问题

3.创建项目

svnadmin create /home/svn/project 此时project下面会多出几个文件

root@ubuntu-14:/home/svn/project# ls -a 
. .. conf db format hooks locks README.txt

然后进行读写授权

chmod
-R 777 /home/svn/project   否则在代码提交的时候会出现commit failed !can't open file
'/home/fruits/svn/projects/code/testsvn/db/txn-current-lock'!

4.cd conf

root@ubuntu-14:/home/svn/project#
cd conf 
root@ubuntu-14:/home/svn/project/conf#
ls -a 
. .. authz hooks-env.tmpl passwd svnserve.conf

5.开始修改配置文件

root@ubuntu-14:/home/svn/project/conf#
vi authz

[aliases]

[groups]
#用户分组

#
harry_and_sally=harry,sally

#
harry_sally_and_joe=harry,sally,&joe

admin=pm,admin

test=test

[/]
#组赋予读写权限的设置

@admin=rw

@test=r

还可以设置具体的目录权限

[/projectname/目录/子目录]

6.root@ubuntu-14:/home/svn/project/conf# vi
svnserve.conf

[general]

###
The anon-access and auth-access options control access to the

###
repository for unauthenticated (a.k.a. anonymous) users and

###
authenticated users, respectively.

###
Valid values are "write", "read", and "none".

###
Setting the value to "none" prohibits both reading and writing;

###
"read" allows read-only access, and "write" allows complete

###
read/write access to the repository.

###
The sample settings below are the defaults and specify that anonymous

###
users have read-only access to the repository, while authenticated

###
users have read and write access to the repository.

anon-access=read

auth-access=write

###
The password-db option controls the location of the password

###
database file. Unless you specify a path starting with a /,

###
the file's location is relative to the directory containing

###
this configuration file.

###
If SASL is enabled (see below), this file will NOT be used.

###
Uncomment the line below to use the default password file.

password-db=passwd

###
The authz-db option controls the location of the authorization

###
rules for path-based access control. Unless you specify a path

###
starting with a /, the file's location is relative to the

###
directory containing this file. The specified path may be a

###
repository relative URL (^/) or an absolute file:// URL to a text

###
file in a Subversion repository. If you don't specify an authz-db,

###
no path-based access control is done.

###
Uncomment the line below to use the default authorization file.

authz-db=authz

7.然后就是修改passwd文件

直接就是在【user】进行username=password的格式显示密码,如果你要支持http格式加密的访问这里暂时不用配置

htpasswd -c /home/svn/project/conf/passwd
username   然后会让输入2次密码

之后在进行添加用户的时候要去掉 -c 否则就会覆盖所有

例如:添加test

htpasswd
/home/svn/project/conf/passwd test

注:因为已存在passwd文件 htpasswd命令会报格式错误,最好删除创建仓库已存在的passwd文件,或者创建一个新文件

test:$apr1$FIjm/2hw$WtCyafEOc9rqBsPAewWGl1
  #这是加密之后的

如果进行修改密码 这样操作也是可以的

8.配置apache

root@ubuntu-14:~#
cd /etc/apache2/mods-available/ 
root@ubuntu-14:/etc/apache2/mods-available#
vi dav_svn.conf

<Location /project>

DAV svn

#SVNParentPath /home/svn

SVNPath /home/svn/project

ModMimeUsePathInfo on

AuthzSVNAccessFile /home/svn/project/conf/authz

AuthzSVNAnonymous off

AuthzSVNNoAuthWhenAnonymousAllowed off

AuthType Basic

AuthName "Subversion"

AuthUserFile /home/svn/project/conf/passwd

Require valid-user

</Location>

9.如果要修改apache2端口[可以不做]

root@ubuntu-14:/etc/apache2#
vi ports.conf

Listen 端口      #你想要的端口

<IfModule
ssl_module>

Listen 443

</IfModule>

<IfModule
mod_gnutls.c>

Listen 443

</IfModule>

10.如果你想修改SVN默认的端口[可以不做]

重新指定一个端口号(默认端口3690)比如修改为3691
svnserve -d –listen-port 3691 -r
/home/svn/project

11.配置完毕重启/etc/init.d/apache2 restart

在ubuntu上安装svn+apache2的更多相关文章

  1. 在Ubuntu上安装LAMP服务器

    1.安装Ubuntu上安装LAMP apt-get install lamp-server^ 2.安装过程中设置MySql密码 3.测试 创建index.php var/www/html/index. ...

  2. 【转载】如何在Ubuntu上安装LAMP服务器系统?

    转载自:http://os.51cto.com/art/201307/405333.htm [2013年7月25日 51CTO外电头条]为何应该在Ubuntu上安装LAMP服务器?从事Web开发工作时 ...

  3. [转载]如何在Ubuntu上安装LAMP服务器系统

    [2013年7月25日 51CTO外电头条]为何应该在Ubuntu上安装LAMP服务器?从事Web开发工作时,我更偏爱在不受干扰的情况下,在我那台计算机上的开发环境下进行开发.我宁愿所犯的错误大部分是 ...

  4. 如何在Ubuntu上安装LAMP服务器系统?

    在Ubuntu上安装LAMP Ubuntu的开发人员让人们很容易安装和配置LAMP软件包,只要借助一个终端命令.所以,打开终端窗口,让我们开始入手吧. sudo apt-get install lam ...

  5. 如何在Linux(Ubuntu)上安装Redmine

    费话就不多说了,本文主要描述如何在如何在Linux(Ubuntu)上安装Redmine.通过这篇文章你将了解如下内容. TL;DR 在Linux(Ubuntu)上安装Redmine的基本流程 配置ph ...

  6. [异常解决] ubuntu上安装JLink驱动遇到的坑及给后来者的建议

    一.前言 最近将整个电脑格式化,改成了linux操作系统 希望这样能让自己在一个新的世界探索技术.提升自己吧- win上的工具用多了,就不想变化了- 继上一篇<ubuntu上安装虚拟机遇到的问题 ...

  7. Ubuntu上安装Robomongo及添加到启动器

    到目前为止,Robomongo仍是MongoDB最好的客户端管理工具,如需在Ubuntu上安装Robomongo,可直接从官网下载.tar.gz压缩包进行解压,然后直接运行bin目录下的robomon ...

  8. 在 Ubuntu 上安装 Android Studio

    在 Ubuntu 上安装 Android Studio http://www.linuxidc.com/Linux/2013-05/84812.htm 打开terminal,输入以下命令 sudo a ...

  9. Ubuntu上安装Karma失败对策

    在Ubuntu上安装Karma遇到超时 timeout 错误.Google了一下,国外的码农给了一个快捷的解决方案,实测可行,贴在这里: sudo apt-get install npm nodejs ...

随机推荐

  1. hdu 2112 HDU Today(map与dijkstra的结合使用)

    HDU Today Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  2. ABAP权限检查,TCode与权限对象进行关联

    一.确认权限对象,和关联字段: Tcode:SU21 维护权限对象例如"M_MSEG_WMB",它关联字段为'WERKS'M_MSEG_WMB 物料凭证:工厂 二.在ABAP代码中 ...

  3. 和openjdk在一起的第一天-第一次接触有些生疏,就先熟悉一下吧

    暂时搞到了openjdk7,就将就着看吧,(为什么csdn全部都是收费啊,llllj),但是还是决定先读这个openjdk7 还有,不知道怎么的就想试试markdown,也不知道好用不 hello w ...

  4. 【python】判断字符串以什么开头或结尾

    项目中用到python判断一个字符串是否以某个字符串结尾,比如,筛选一个目录下所有以.mp4结尾的文件. >>> item = "demo.mp4" >&g ...

  5. 方阵行列式并行化计算(OpenMP,MPI),并计算加速比

    00][100].在创建方阵时,方阵的阶数N(N<100)由外部输入.然后用两层"for循环"来给方阵 p左上角 N×N个位置赋值.具体实现如下: /* * 定义矩阵阶数N ...

  6. Python操作——Memcached

    Memcached是一个高性能的分布式内存对象缓存系统,用于Web应用以减轻数据库的负载. 它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态.数据库驱动网站的速度. Memcached ...

  7. AJAX实现三级联动

    省市区三级联动插件: 主页面:为方便使用,不用写过多代码,只写一个id为sanji的div,若别的页面要用,只需写一个id为sanji的div,加载上jQuery与sanji.js文件即可 <! ...

  8. springboot打war包

    修改pom为war不是jar. 移除tomcar的jar依赖: <dependency> <groupId>org.springframework.boot</group ...

  9. Linux基本命令 vim命令(二)

    Linux Vim显示行号 在命令模式下输入" : " 进入编辑模式后执行 set nu 命令 即可显示每一行的行号,如果想要取消行号,则再次输入":set nonu&q ...

  10. P4755 Beautiful Pair

    题目 洛谷 做法 \(i≤x≤j,a[i]<\frac{a[x]}{a[j]}\) 考虑\(a[x]\)的贡献,单调栈预处理\(L,R\)能作为最大值的区间 枚举一端点,仅需另一端点满足条件即可 ...