当前位置:首页 > 操作系统 > Linux

Ubuntu Linux下创建Subversion服务 三步曲

Ubuntu Linux下创建Subversion服务 三步曲

第一步,安装必要的软件
/>Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->sudo apt-get install apache2  subversion libapache2-svn apache2-utils 
启动apache2, sudo /etc/init.d/apache2 start, 然后通过http://ipaddress/ 查看是否可以访问
第二步,配置SVN
/>Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->sudo mkdir /home/svn                                          #创建SVN目录
sudo svnadmin create /home/svn/repo                     #创建SVN源目录
sudo chown -R www-data:www-data /home/svn         #给Aapche用户添加权限
sudo htpasswd -c /etc/subversion/test.users lilei        #创建用户和密码
                   New password:
                    Re-type new password:
                   Adding password for user lilei
如果只是添加lilei, 去掉-c即可                                            
配置/etc/apache2/site-enabled/svn.conf                      #添加SVN工作目录到apache
<location /repos>
DAV svn
# SVN path
SVNParentPath /home/svn/
AuthType Basic
AuthName "Authorization Realm"
#password file path
AuthUserFile /etc/subversion/test.users
Require valid-user
</location>
重启apache2
sudo /etc/init.d/apache2 restart
第三步,使用和测试
浏览器打开 http://ipaddress/repos/repo,提示用户输入用户名和密码,输入刚才输入的用户名和密码即可。
使用SVN客户端或者直接在SVN命令行测试
svn co http://ipaddress/repos/repo repo --username lilei
cd repo
touch a.txt
touch b.txt
svn add
svn commit -m"test"
然后再通过http://ipaddress/repos/repo访问就可以看到两个文件。祝好运,如果有问题可以和我单独联系。

原文:http://www.blogjava.net/nkjava/archive/2014/11/05/419533.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐