安装sqlite(sqlite-autoconf-3130000.tar.gz)
tar zxvf sqlite-autoconf-3130000.tar.gz cd sqlite-autoconf-3130000 ./configure --prefix=/usr/local/sqlite make make install
安装svn(subversion-1.9.4.tar.gz):
tar zxvf subversion-1.9.4.tar.gz cd subversion-1.9.4 ./configure --prefix=/usr/local/svn --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-sqlite=/usr/local/sqlite --with-zlib=/user/local/zlib make make install
svnserve --version
创建仓库:
mkdir /var/svn cd /var/svn /usr/local/svn/svnadmin create test
配置仓库文件:
cd /var/svn/test/conf
vim svnserve.conf
去掉注释#:
anon-access = read #并把read该成none,指未定义用户不能查看 auth-access = write #用户可以写操作 password-db = passwd #启用用户的账号密码文件 authz-db = authz #启用用户的权限文件 realm = test #版本库的认证域,修改为test 配置authz: vim authz [groups] team = admin, leader #team表示组名,team组中有用户admin和leader [/] #如果在启动svn时是svnserve -d -r /var/svn,那么[/]的目录就在/var/svn,即根目录 @team = rw #给team组读写权限,也可以给某个用户特定的权限:user = r * = 配置passwd: vim passwd [users] admin = 123 #用户名密码 leader = 123 设置环境变量: vim /etc/profile export PATH=/usr/local/svn/bin:$PATH
退出后
source /etc/profile
启动svn服务:
svnserve -d -r /var/svn #默认端口3690
ps -ef | grep svnserve
查看端口:
netstat -tnl
vim /etc/init.d/svnserve
添加:
#!/bin/sh #chkconfig: 2345 10 90 #description: auto start subversion /usr/local/svn/bin/svnserve -d -r /var/svn
添加执行权限:
chmod +x /etc/init.d/svnserve
林外听秋风