SVN Apache安装配置
Apache通过DAV来实现对SVN的访问实现,所以首先要安装DAV插件
1、安装相关软件包
yum install mod_dav_svn httpd apr apr-util per-URI none sqlite
安装完成之后会在/etc/httpd/conf.d/subversion.conf 这个文件会载入相关的库文件,
wget 先下载这个文件是必须的
tar zxvf sqlite-amalgamation-3.7.6.3.tar.gz
./configure --prefix=/usr/local/sqlite
make && make install
wget
tar jxvf subversion-1.7.2.tar.bz2
./autogen.sh
./configure --prefix=/usr/local/svn --with-sqlite=/usr/local/sqlite
make && make install 安装成功
2、启动svn
/usr/local/svn/bin/svnserve -d -r /usr/local/svn
ps aux | grep svn
root 17275 0.0 0.0 147112 932 ? Ss 18:17 0:00 /usr/local/svn/bin/svnserve -d -r /usr/local/svn
3、apache的配置
cat /etc/httd/conf/httpd.conf |grep svn 在apache中配置如下内容
DAV svn
SVNParentPath "/usr/local/svn/" 这个是父目录,下面的是具体的版本库
AuthzSVNAccessFile "/usr/local/svn/test/conf/access.auth"
Require valid-user
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile "/usr/local/svn/repos/conf/users.auth"
Require valid-user
4、创建版本库及导入版本库
svnadmin create --fs-type fsfs /usr/local/svn/repos //在svn目录下创建一个版本库,指定格式为fsfs
svnadmin create --fs-type fsfs /usr/local/svn/test
/usr/local/svn/bin/svn import /usr/local/src/jj file:///usr/local/svn/repos/ --message "init"
Adding /usr/local/src/jj/passwd2
Committed revision 1.
htpasswd -cb /usr/local/svn/repos/conf/users.auth test 123456 创建用户名test密码123456
chown -R apache.apache /usr/local/svn
service httpd restart //重启httpd之后就可以访问了
遇到的问题:
1、Could not open the requested SVN filesystem
由于用rpm 和源码同时安装了subversion,导致报这个错。pkill -9 svn
/usr/local/svn/bin/svnserve -d -r /usr/local/svn 重启即可
2、Permission denied: Could not open password file: /usr/local/svn/repos/conf/users.auth
权限问题,由于users.auth是700 root所以导致不能打开
chown apache.apache users.auth
阅读(2405) | 评论(0) | 转发(0) |