如何在CentOS 7.0 安装 Websvn

如何在CentOS 7.0 安装 Websvn

大家好,今天我们会在CentOS 7.0 上为 subversion(SVN)安装Web 界面 WebSVN。(subverion 是 apache 的顶级项目,也称为 Apache SVN 或 SVN)

WebSVN 将 Svbverion 的操作你的仓库的各种功能通过 Web 界面提供出来。通过它,我们可以看到任何给定版本的任何文件或者目录的日志,并且可看到所有文件改动、添加、删除的列表。我们同样可以查看两个版本间的差异来知道特定版本改动了什么。

特性

WebSVN提供了下面这些特性:

  • 易于使用的用户界面
  • 可定制的模板系统
  • 色彩化的文件列表
  • 追溯视图
  • 日志信息查询
  • RSS支持
  • 更多

由于其使用PHP写成,WebSVN同样易于移植和安装。

现在我们将为Subverison安装WebSVN。请确保你的服务器上已经安装了 SVN。如果你还没有安装,你可以按本教程安装。

安装完SVN后,你需要以下几步。

1. 下载 WebSVN

你可以从官方网站 http://www.websvn.info/download/ 中下载 WebSVN。我们首先进入 /var/www/html/ 并在这里下载安装包。

 
  
  1. $ sudo -s

请在shell或者终端中执行上面的命令,因为我们需要切换到root权限来对系统限制区域有访问权。

 
  
  1. # cd /var/www/html
  2. # wget http://websvn.tigris.org/files/documents/1380/49057/websvn-2.3.3.zip

downloading websvn package

downloading websvn package

这里,我下载的是最新的2.3.3版本的 websvn。你可以从上面这个网站找到下载链接,用适合你的包的链接来替换上面的链接。

2. 解压下载的zip

 
  
  1. # unzip websvn-2.3.3.zip
  2. # mv websvn-2.3.3 websvn

extracting websvn

extracting websvn

3. 安装php

 
  
  1. # yum install php

yum install php

yum install php

4. 编辑WebSVN配置

现在,我们需要拷贝位于 /var/www/html/websvn/include 的 distconfig.php 为 config.php,并且接着编辑该配置文件。

 
  
  1. # cd /var/www/html/websvn/include
  2. # cp distconfig.php config.php
  3. # nano config.php

现在我们需要按如下改变文件。完成之后,请保存并退出。

 
  
  1. // Configure these lines if your commands aren't on your path.
  2. //
  3. $config->setSVNCommandPath('/usr/bin'); // e.g. c:\\program files\\subversion\\bin
  4. $config->setDiffPath('/usr/bin');
  5. // For syntax colouring, if option enabled...
  6. $config->setEnscriptPath('/usr/bin');
  7. $config->setSedPath('/bin');
  8. // For delivered tarballs, if option enabled...
  9. $config->setTarPath('/bin');
  10. // For delivered GZIP'd files and tarballs, if option enabled...
  11. $config->setGZipPath('/bin');
  12. //
  13. $config->parentPath('/svn/');
  14. $extEnscript[".pl"] = "perl";
  15. $extEnscript[".py"] = "python";
  16. $extEnscript[".sql"] = "sql";
  17. $extEnscript[".java"] = "java";
  18. $extEnscript[".html"] = "html";
  19. $extEnscript[".xml"] = "html";
  20. $extEnscript[".thtml"] = "html";
  21. $extEnscript[".tpl"] = "html";
  22. $extEnscript[".sh"] = "bash";

websvn config file

websvn config file

5. 启动 WebSVN

现在,我们将近完成了。现在需要重启Apache服务。你可以用下面的命令。

 
  
  1. # systemctl restart httpd.service

接着我们在浏览器中打开WebSVN,输入 http:// IP地址/websvn ,或者你在本地的话,你可以输入 http://localhost/websvn 。

websvn successfully installed

websvn successfully installed

注意: 如果你遇到一个像"Unable to find "enscript" tool at location "/usr/bin/enscript"这样的问题,那么你需要使用“yum install enscript”安装enscript来修复这个问题。

总结

好了,我们已经在CentOS 7上完成WebSVN的安装了。这个教程同样适用于RHEL 7。

如果你有任何问题、评论、反馈请在下面的评论栏中留下,来让我们知道该添加什么和改进。谢谢! 用用看吧。

原文发布时间:2015-03-31

本文来自云栖合作伙伴“linux中国”


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值