安装配置websvn,支持web方式浏览svn

来源:互联网 发布:数据分析服务合同 编辑:程序博客网 时间:2024/06/06 03:20
websvn是用 php开发的,功能也是为svn提供web 浏览功能。安装配置方法如下:

安装apache

wget http://www.wmwweb.com/apache/httpd/httpd-2.2.3.tar.gz
tar xfvz httpd-2.2.3.tar.gz
cd httpd-2.2.3
./configure –prefix=/usr/local/apache2 –enable-module=so –enable-module=setenvif –enable-module=rewrite –enable-rewrite=shared –enable-proxy=shared –with-mpm=prefork –enable-so –enable-auth-anon –enable-file-cache=shared –enable-cache=shared –enable-disk-cache=shared –enable-mem-cache=shared

make clean
make
make install

配置apache


增加用户apache
useradd apache
passwd apache
按照提示输入密码

修改httpd.conf

vi /usr/local/apache2/conf/httpd.conf

User daemon
Group daemon
改成
User apache
Group apache

Options Indexes FollowSymLinks
改成
Options -ExecCGI -Indexes FollowSymLinks


Order allow,deny
Deny from all
Satisfy All

之后增加

Order allow,deny
Deny from all
Satisfy All


Order allow,deny
Deny from all
Satisfy All

AddType application/x-gzip .gz .tgz
之后增加
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

DirectoryIndex index.html
改成
DirectoryIndex index.html index.php

安装php

wget http://cn2.php.net/get/php-5.1.6.tar.gz/from/this/mirror
tar xfvz php-5.1.6.tar.gz
cd php-5.1.6
./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –enable-mbstring –enable-track-vars –enable-calendar –enable-trans-sid –with-gettext –enable-sysvmsg –enable-sockets –enable-bcmath –enable-wddx –disable-debug –with-dom=/usr/local
make clean
make
make install
cp php.ini-recommended /usr/local/apache2/conf/php.ini

安装websvn

cd /usr/local/apache2/htdocs
mkdir websvn
cd websvn
wget -np -nH –cut-dirs=4 -r -v http://guest:@websvn.tigris.org/svn/websvn/tags/2.0rc4/

配置websvn

配置config.inc

cd include
cp distconfig.inc config.inc
vi config.inc
编辑文件,使其只包含以下几项内容:

版本库,格式$config->addRepository(<显示名>, svn串, group, <用户名>, <密码>);
如 $config->addRepository(”docs”, “svn://192.168.0.1:1234/repos1/test”, NULL, “test”, “test1″);
svn串可以指定到任意目录,svn协议是通过svnserve访问版本库,所以受到svnserve用户和权限的限制,这样比较安全
指定的用户名和密码必须对目录有读权限,建议为websvn单独设置用户。

指定模版:
$config->setTemplatePath(”$locwebsvnreal/templates/BlueGrey/”);

指定字符集:
$config->setInputEncoding(”UTF-8″);
$config->setContentEncoding(”GB18030″);

指定语言:
include ‘languages/schinese.inc’;

允许下载:
$config->allowDownload();

其他:
$config->setMinDownloadLevel(2);
$config->setCachingOn();
$config->expandTabsBy(4);

修改websvn模版

由于中文和英文宽度的差异,需要做一些修改。

通过ftp,将/usr/local/apache2/htdocs/websvn/languages/schinese.inc下载到windows机器上。将文件中的”查看记录”改成”查看”,再ftp回Linux机器。

vi /usr/local/apache2/htdocs/websvn/templates/BlueGrey/directory.tmp
修改或添加下图红色的部分(HTML贴上来总是报错,只能以图说明了):

运行websvn

/usr/local/apache2/bin/apachectl start

用浏览器访问http://192.168.0.1/websvn就可以浏览svn版本库了。

特殊说明
目前的配置下,websvn可以正确显示文件中GB编码的汉字,但不能显示UTF-8格式的汉字。可以满足大多数情况下的要求。

原创粉丝点击