Linux 下安装subversion 详细指南
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
免费下载资源
·
1 下载相关的软件
Apache-2.x
http://httpd.apache.org 下载源代码包
Subersion
http://subversion.tigris.org/ 下载源代码包
本文中apache的版本为 Apache/2.2.4 (Unix)
Subversion 版本:svnserve 1.4.3 (r23084)
2 安装相关软件
2.1 安装apache
1)./configure –prefix=/usr/local/apache(安装目录)–enable-so –enable-proxy –enable-ssl –enable-vhost-alias –enable-mods-shared=most –enable-dav –enable-maintainer-mode
说明:其中—enable-dav 和—enable-maintainer-mode是为了能在apache下集成subversion才加进去的编译参数。
–with-mpm=worker
(这个参数,要详细阅读
apache
的
相关文档来做决定用哪种
mpm
,待定)
2)make (编译)
3)make install (安装)
4)make clean(清理源代码目录)
3 创建仓库
2.2 安装subversion
1)配置
./configure –prefix=/home/svn –enable-maintainer-mode –with-apr=/usr/local/apache2/bin/apr-1-config –with-apxs=/usr/local/apache2/bin/apxs –with-apr-util=/usr/local/apache2/bin/apu-1-config
其中:/usr/local/apache2为apache的安装目录,而不是源代码目录。
2)make
3)make install
4)make clean
仓库的规划一般是有一个仓库,其中存放一个或者多个项目根目录,在每个项目根目录下面有
/trunk,
/branches, and
/tags
三个子目录,或者另外的规划。
/
utils/
calc/
trunk/
tags/
branches/
calendar/
trunk/
tags/
branches/
…
office/
spreadsheet/
trunk/
tags/
branches/
…
无论哪种规划,但是都必须遵循的一个原则就是必须符合你的项目的设计。
3.2 创建仓库
根据上面一节的规划来创建你的仓库。
1) 创建仓库
$ svnadmin create /path/to/repos
观察repos目录结构
2) 根据仓库规划,创建临时目录:
$mkdir tmpdir
$cd tmpdir
$mkdir boss (boss在这里是project name)
$mkdir boss/trunk
$mkdir boss/tags
$mkdir boss/branches
3) 添加上面创建的目录结构到1)中创建的仓库中去
$svn import . file:///path/to/repos –message ‘Initial repository layout’
.:代表当前目录
file段:代表1)中创建的仓库
4 subversion服务器配置
Subversion 的服务器运行方式分为两种:http方式和tcp(以svnserve)方式。
4.1 http方式配置
结合apache的dav模块来是实现。
在apache的安装目录下面找到配置文件httpd.conf,修改配置文件。
<Location /svn>
DAV svn
SVNPath /home/svn/repos
</Location>
4.2 svn方式配置
Subversion以svnserve方式运行
1) standalone mode
直接运行:#svnserve –d运行 lsof -i :3690可以看到SVN服务器已经在运行
2) xinetd mode在/etc/xinetd.d/下生成svnserve文件,内容如下
service svnserve
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /home/svn/bin/svnserve
server_args = -i
}
编辑 /etc/services 檔,加入底下两行:
svnserve 3690/tcp # Subversion svnserve
svnserve 3690/udp # Subversion svnserve
重启xinetd服务/usr/sbin/xinetd –restart
运行 lsof -i :3690可以看到SVN服务器已经在运行
service svnserve
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /home/svn/bin/svnserve
server_args = -i
}
编辑 /etc/services 檔,加入底下两行:
svnserve 3690/tcp # Subversion svnserve
svnserve 3690/udp # Subversion svnserve
重启xinetd服务/usr/sbin/xinetd –restart
运行 lsof -i :3690可以看到SVN服务器已经在运行
5 服务器配置
5.1 服务器配置
Subversion的配置文件存放在$SVN_HOME/your repository/conf目录下面,配置文件名:svnserve.conf。
1) 基本权限管理
svnserve.conf的配置风格跟mysql的配置文件的风格相似。基于linux下的配置文件风格如下:
[xxx] section:配置段
配置段下面的配置区域,一般是:变量 = 值
在svnserve.conf中[general]段,访问权限分为三种:read,write,none
anon-access = none (对匿名用户)
auth-access = write
(授权用户)
2) 基于svn自己权限管理
Svn本身通过password-db = userfile和realm = my first实现了权限管理。
Password-db是权限文件放置位置。
Realm是加密的key
权限文件的格式类似如下:
[users]
A=123456 (其中a为用户名,123456为密码)
3)基于svn+ssh权限管理(略)
附录:
命令列表
具体用法可参考 Subversion 命令参考手册
Subversion 命令列客户端: svn
svn add
svn cat
svn checkout
svn cleanup
svn commit
svn copy
svn delete
svn diff
svn export
svn help
svn import
svn info
svn list
svn log
svn merge
svn mkdir
svn move
svn propdel
svn propedit
svn propget
svn proplist
svn propset
svn resolved
svn revert
svn status
svn switch
svn update
Subversion 命令列服务端:
svnadmin list-unused-dblogs
svnadmin create
svnadmin dump
svnadmin help
svnadmin load
svnadmin lstxns
svnadmin recover
svnadmin rmtxns
svnadmin setlog
svnlook author
svnlook cat
svnlook changed
svnlook date
svnlook diff
svnlook dirs-changed
svnlook help
svnlook history
svnlook info
svnlook log
svnlook proplist
svnlook tree
svnlook youngest
具体用法可参考 Subversion 命令参考手册
Subversion 命令列客户端: svn
svn add
svn cat
svn checkout
svn cleanup
svn commit
svn copy
svn delete
svn diff
svn export
svn help
svn import
svn info
svn list
svn log
svn merge
svn mkdir
svn move
svn propdel
svn propedit
svn propget
svn proplist
svn propset
svn resolved
svn revert
svn status
svn switch
svn update
Subversion 命令列服务端:
svnadmin list-unused-dblogs
svnadmin create
svnadmin dump
svnadmin help
svnadmin load
svnadmin lstxns
svnadmin recover
svnadmin rmtxns
svnadmin setlog
svnlook author
svnlook cat
svnlook changed
svnlook date
svnlook diff
svnlook dirs-changed
svnlook help
svnlook history
svnlook info
svnlook log
svnlook proplist
svnlook tree
svnlook youngest
bash-3.2# ls -al /usr/local/lib/libexpat.* /usr/local/include/expat.h
-rw-r--r-- 1 root wheel 40339 Jan 14 02:43 /usr/local/include/expat.h
-rw-r--r-- 1 root wheel 444628 Jan 14 02:43 /usr/local/lib/libexpat.a
-rwxr-xr-x 1 root wheel 793 Jan 14 02:43 /usr/local/lib/libexpat.la
lrwxr-xr-x 1 root wheel 13 Jan 14 02:43
/usr/local/lib/libexpat.so -> libexpat.so.6
-rwxr-xr-x 1 root wheel 265921 Jan 14 02:43 /usr/local/lib/libexpat.so.6
bash-3.2#
-rw-r--r-- 1 root wheel 40339 Jan 14 02:43 /usr/local/include/expat.h
-rw-r--r-- 1 root wheel 444628 Jan 14 02:43 /usr/local/lib/libexpat.a
-rwxr-xr-x 1 root wheel 793 Jan 14 02:43 /usr/local/lib/libexpat.la
lrwxr-xr-x 1 root wheel 13 Jan 14 02:43
/usr/local/lib/libexpat.so -> libexpat.so.6
-rwxr-xr-x 1 root wheel 265921 Jan 14 02:43 /usr/local/lib/libexpat.so.6
bash-3.2#
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
已为社区贡献1条内容
所有评论(0)