题记:好久以前装了一次,然后歇了一段时间又需要使用,发现自己忘了差不多,遂有此文。
一 安装说明
1.1 环境
[[email protected] ~]# lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.6 (Final) Release: 6.6 Codename: Final
1.2 安装用户root
1.3 安装方式yum
二 安装mod_dav_svn subversion httpd
说明:subversion 版本控制server
httpd web 服务器
mod_dav_svn :subversion 的httpd 模块插件
第一没有安装这个插件 导致失败了。
2.1 检查原系统是否安装过
[[email protected] ~]# rpm -ql httpd package httpd is not installed [[email protected] ~]# rpm -ql mod_dav_svn package mod_dav_svn is not installed [[email protected] ~]# rpm -ql subversion package subversion is not installed
2.2 yum 安装
yum install mod_dav_svn subversion httpd
2.3 验证
2.3.1 验证httpd
[[email protected] conf]# service httpd start Starting httpd: [Tue Aug 11 17:49:02 2015] [warn] module dav_svn_module is already loaded, skipping [Tue Aug 11 17:49:02 2015] [warn] module authz_svn_module is already loaded, skipping httpd: Could not reliably determine the server‘s fully qualified domain name, using 10.59.9.9 for ServerName [ OK ]
可以通过浏览器访问http://serverip,或者看下80端口是否启动(我这里没有修改httpd 监听端口)
2.3.2 启动svn
2.3.2.1 建立svnreps目录
2.3.2.2 svn 建立仓库
2.3.2.3 启动仓库
[[email protected] www]# mkdir -p /var/svn/svnrepos [[email protected] www]# svnadmin create /var/svn/svnrepos [[email protected] www]# ll /var/svn/svnrepos/ total 24 drwxr-xr-x 2 root root 4096 Aug 11 17:55 conf drwxr-sr-x 6 root root 4096 Aug 11 17:55 db -r--r--r-- 1 root root 2 Aug 11 17:55 format drwxr-xr-x 2 root root 4096 Aug 11 17:55 hooks drwxr-xr-x 2 root root 4096 Aug 11 17:55 locks -rw-r--r-- 1 root root 229 Aug 11 17:55 README.txt [[email protected] www]# svnserve -d -r /var/svn/svnrepos [[email protected] www]# ps -ef | grep svn root 27425 1 0 17:56 ? 00:00:00 svnserve -d -r /var/svn/svnrepos root 27427 26838 0 17:56 pts/0 00:00:00 grep svn
2.3.2.4 可以用客户端测试svn了。
2.3.3 svn配置修改 添加用户等
2.3.3 备份svn 配置文件
[[email protected] conf]# cp authz authz.orig.bak [[email protected] conf]# cp passwd passwd.orig.bak [[email protected] conf]# cp svnserve.conf svnserve.conf.orig.bak [[email protected] conf]# pwd /var/svn/svnrepos/conf
说明
passwd :用户密码
auth: rw 权限配置
svnserve.conf: svn 的配置 访问是否受限,访问的根目录是哪,注意 修改配置的文件的格式 右靠起,等号两边不能有空格
三httpd 集成svn
3.1 httpd web根目录下建立svn子目录,并将该目录与subversion 关联
[[email protected] html]# mkdir svn [[email protected] html]# pwd /var/www/html [[email protected] html]# svn checkout --username=admin --password=admin file:///var/svn/svnrepos/ /var/www/html/svn/ Checked out revision 0.
3.2 修改httpd 配置文件 httpd.conf (修改之前请备份)
添加如下内容
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so <Location /repos> DAV svn SVNPATH /var/svn/svnrepos </Location>
3.3 重启apache
[[email protected] conf]# service httpd restart
3.4页面验证
暂时写到这~~~~
参考 http://vrlinux.com/xitongguanli/20101124/80747.html
时间: 2024-10-10 01:41:41