使用了多年的CVS,苦来酸甜都尝遍。一直垂涎subversion,却没有机会。而今机缘巧合得以在部门内推广subversion, 不亦悦乎。
因部门开发需要使用RedHat9.0,服务器一直使用这个版本的linux没有升级。9.0自带的subversion版本太低(0.17.1),需要升级到1.4.2。本人较懒,不愿意从源代码安装subversion(一堆编译选项,安装位置等等的选择,甚烦)。好在subersion的fans已经为咱做了准备,有现成的rpm包可以使用。不过天下也没免费的午餐,小小问题还是要自己动手解决的 : )
1. 获取subersion的red hat 9.0的rpm包。
从 http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/redhat-9.0/bin/ 这里获取现成的rpm包。每个包只取最高版本的即可。
2. 卸载9.0自带的包
rpm -e subversion-devel subversion
rpm -e mod_auth_mysql mod_auth_pgsql
注意: 后两个apahce的模块,在我们拿到的rpm包里没有更新的版本可用。本人的工作不会涉及到使用这两个包的情况,没有去找更新的包来安装。
3. 安装和升级下载的rpm包。
9.0自带的使用rpm -Uvh 命令升级,其余的可以使用rpm -ivh安装。升级httpd时,需要把几个相关的mod放在一条命令里一起升级。否则会报几个httpd-mmn的依赖问题。可以参考:
http://www.redhat.com/archives/shrike-list/2003-May/msg00724.html
4. 配置subversion
1)创建svn仓库
svnadmin create --fs-type fsfs /path/to/your/repos
2)import一个project
建立project的目录结构并导入:
svn import --message "Initial import" myproj file:///path/to/your/repos/myproj
3)配置subversion的web访问
在/etc/httpd/conf.d下有一个subversion.conf文件,去掉其中的注释,稍作修改即可为我所用:
# Needed to do Subversion Apache server.
LoadModule dav_svn_module modules/mod_dav_svn.so
# Only needed if you decide to do "per-directory" access control.
LoadModule authz_svn_module modules/mod_authz_svn.so
#
# Settings for Subversion Repository
#
<Location /repos>
DAV svn
SVNPath /path/to/your/repos
AuthzSVNAccessFile /path/to/your/repos/svn-authz-access
AuthType Digest
AuthName "Subversion"
AuthDigestDomain /repos/
AuthDigestFile /path/to/your/repos/svn-auth-file
Require valid-user
</Location>
设置目录访问权限,首先设为我自己可用,其余人只读,做个测试。
svn-authz-access:
[/]
* = r
linuxnewer = rw
设置digest方式的用户名密码
htdigest -c /path/to/your/repos/svn-auth-file Subversion linuxnewer
OK.至此安装和配置已经完成,启动http服务试验一下。
/etc/rc.d/init.d/httpd start
web浏览器访问正常,大喜。
用命令行访问:
svn co http://localhost/repos/myproj
输入用户名,密码,结果抱错:
svn: REPORT 请求 “/repos/!svn/vcc/default”失败
svn: Not authorized to open root of edit operation
看来还用费点儿功夫。
6. 解决最后的问题
google一下出错信息,蛛丝马迹颇多,仔细寻找发现是digest模块的问题,且该问题已被提交到apchace的bug track系统。好,上去查查,发现:
http://issues.apache.org/bugzilla/show_bug.cgi?id=25040
里面有一个digest模块的patch,喜出望外。
从 http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/redhat-9.0/src/取回httpd的源码包,安装rpm -ivh。
把找到的patch放在/usr/src/redhat/SOURCES下,命名为httpd-2.0.48-digest.patch。
修改spec文件:在/usr/src/redhat/SPEC/httpd.spec中添加
Patch37: httpd-2.0.48-digest.patch
%patch37 -p1 -b .digest
具体的位置,参考原spec文件,和相关的内容放在一起就可以了。
编译,rpmbuild -bc。成功。
把/usr/src/redhat/BUILD/httpd-2.0.48/worker/modules/aaa/.libs/mod_auth_digest.so拷贝到/usr/lib/httpd/modules下覆盖原文件。
重起http服务,web页面访问OK,命令行访问OK。狂喜。
7. 与此问题相关的一些链接
http://issues.apache.org/bugzilla/show_bug.cgi?id=25040
http://subversion.tigris.org/issues/show_bug.cgi?id=1608
http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=50861
http://subversion.tigris.org/faq.html
因部门开发需要使用RedHat9.0,服务器一直使用这个版本的linux没有升级。9.0自带的subversion版本太低(0.17.1),需要升级到1.4.2。本人较懒,不愿意从源代码安装subversion(一堆编译选项,安装位置等等的选择,甚烦)。好在subersion的fans已经为咱做了准备,有现成的rpm包可以使用。不过天下也没免费的午餐,小小问题还是要自己动手解决的 : )
1. 获取subersion的red hat 9.0的rpm包。
从 http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/redhat-9.0/bin/ 这里获取现成的rpm包。每个包只取最高版本的即可。
2. 卸载9.0自带的包
rpm -e subversion-devel subversion
rpm -e mod_auth_mysql mod_auth_pgsql
注意: 后两个apahce的模块,在我们拿到的rpm包里没有更新的版本可用。本人的工作不会涉及到使用这两个包的情况,没有去找更新的包来安装。
3. 安装和升级下载的rpm包。
9.0自带的使用rpm -Uvh 命令升级,其余的可以使用rpm -ivh安装。升级httpd时,需要把几个相关的mod放在一条命令里一起升级。否则会报几个httpd-mmn的依赖问题。可以参考:
http://www.redhat.com/archives/shrike-list/2003-May/msg00724.html
4. 配置subversion
1)创建svn仓库
svnadmin create --fs-type fsfs /path/to/your/repos
2)import一个project
建立project的目录结构并导入:
svn import --message "Initial import" myproj file:///path/to/your/repos/myproj
3)配置subversion的web访问
在/etc/httpd/conf.d下有一个subversion.conf文件,去掉其中的注释,稍作修改即可为我所用:
# Needed to do Subversion Apache server.
LoadModule dav_svn_module modules/mod_dav_svn.so
# Only needed if you decide to do "per-directory" access control.
LoadModule authz_svn_module modules/mod_authz_svn.so
#
# Settings for Subversion Repository
#
<Location /repos>
DAV svn
SVNPath /path/to/your/repos
AuthzSVNAccessFile /path/to/your/repos/svn-authz-access
AuthType Digest
AuthName "Subversion"
AuthDigestDomain /repos/
AuthDigestFile /path/to/your/repos/svn-auth-file
Require valid-user
</Location>
设置目录访问权限,首先设为我自己可用,其余人只读,做个测试。
svn-authz-access:
[/]
* = r
linuxnewer = rw
设置digest方式的用户名密码
htdigest -c /path/to/your/repos/svn-auth-file Subversion linuxnewer
OK.至此安装和配置已经完成,启动http服务试验一下。
/etc/rc.d/init.d/httpd start
web浏览器访问正常,大喜。
用命令行访问:
svn co http://localhost/repos/myproj
输入用户名,密码,结果抱错:
svn: REPORT 请求 “/repos/!svn/vcc/default”失败
svn: Not authorized to open root of edit operation
看来还用费点儿功夫。
6. 解决最后的问题
google一下出错信息,蛛丝马迹颇多,仔细寻找发现是digest模块的问题,且该问题已被提交到apchace的bug track系统。好,上去查查,发现:
http://issues.apache.org/bugzilla/show_bug.cgi?id=25040
里面有一个digest模块的patch,喜出望外。
从 http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/redhat-9.0/src/取回httpd的源码包,安装rpm -ivh。
把找到的patch放在/usr/src/redhat/SOURCES下,命名为httpd-2.0.48-digest.patch。
修改spec文件:在/usr/src/redhat/SPEC/httpd.spec中添加
Patch37: httpd-2.0.48-digest.patch
%patch37 -p1 -b .digest
具体的位置,参考原spec文件,和相关的内容放在一起就可以了。
编译,rpmbuild -bc。成功。
把/usr/src/redhat/BUILD/httpd-2.0.48/worker/modules/aaa/.libs/mod_auth_digest.so拷贝到/usr/lib/httpd/modules下覆盖原文件。
重起http服务,web页面访问OK,命令行访问OK。狂喜。
7. 与此问题相关的一些链接
http://issues.apache.org/bugzilla/show_bug.cgi?id=25040
http://subversion.tigris.org/issues/show_bug.cgi?id=1608
http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=50861
http://subversion.tigris.org/faq.html