安装subversion需要依赖aPR、apr-util、sqlite,下载安装包,放在/usr/file目录
subversion-1.9.4.tar.gzapr-1.5.2.tar.gzapr-util-1.5.4.tar.gzsqlite-amalgamation-3150100.zip解压
cd /usr/file tar xvf subversion-1.9.4.tar.gztar xvf apr-1.5.2.tar.gztar xvf apr-util-1.5.4.tar.gzunzip sqlite-amalgamation-3150100.zip安装aprcd apr-1.5.2.configure --prefix=usr/local/aprmake && make install安装apr-util
cd ../apr-util-1.5.4./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/aprmake && make install配置sqlitecd ../mv sqlite-amalgamation-3150100 ./subversion-1.9.4/sqlite-amalgamation安装subversioncd subversion-1.9.4./configure --prefix=/usr/local/subversion --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-utilmake && make install配置环境变量vi /etc/profile追加以下内容#subversionexport PATH=$PATH:/usr/local/subversion/bin使配置立即生效,并检查安装结果source /etc/profilesvnserve -version配置仓库
仓库路径/usr/svn/repo
mkdir -p /usr/svn/reposvnadmin create /usr/svn/repo仓库目录下会生成文件和目录,编辑cd /usr/svn/repo/confvi svnserve.conf去掉以下几行的注释并修改,注意,行前一定不要留空格anon-access = noneauth-access = writepassWord-db = passwdauthz-db = authzrealm = repo编辑passwd文件vi passwd添加(用户=密码)[users]root = root编辑authz文件vi authz设置权限[groups]admin = root[/]@admin = rw配置服务
接下来将subversion配置成系统服务
启动subversion
svnserve -d --listen-port 9999 -r /usr/svn在/etc/init.d目录创建文件(无后缀)cd /etc/init.dvi svn添加如下内容#!/bin/bash#chkconfig: 2345 90 10##subversion# build this file in /etc/init.d/svn# chmod 755 /etc/init.d/svn#SVN_HOME=/usr/svnif [ ! -f "/usr/local/subversion/bin/svnserve" ]then echo "svnserver startup: cannot start" exitficase "$1" in start) echo "Starting svnserve..." /usr/local/subversion/bin/svnserve -d --listen-port 9999 -r $SVN_HOME echo "started!" ;; stop) echo "Stoping svnserve..." killall svnserve echo "stopped!" ;; restart) $0 stop $0 start ;; *) echo "Usage: svn { start | stop | restart } " exit 1esac设置开机启动chmod 755 /etc/init.d/svnchkconfig svn onsvn启动、关闭命令service svn startservice svn stopservice svn restart常见问题
windows安装tortoiseSVN客户端软件,checkout svn://192.168.25.130:9999/repo
如果遇到问题一
Unable to connect to a repository at URL解决方法:右键“TortoiseSVN”--“Settings”--“Saved Data”,依次“Clear”所有项,重新“checkout”
如果遇到问题二:
line 19: Option expected解决方法:修改subversion配置文件,去掉配置项行前空格
新闻热点
疑难解答