此文由正在戒网独家发布, 其中很多地方耗了本人很多精力才得以解决, 如有转载, 请一定注明原址 https://justchen.com/520.html 谢谢
之前有发表一篇类似的文章, 不过那是针对 submin1.0 版, 现在 submin 已经升级到 2.0, 功能上有小些变化, 现在我再重新整理, 留为备份:
安装 Subversin 及相关需要的模块:
apt-get install subversion libapache2-svn -y
apt-get install libapache2-mod-python libapache2-mod-python-doc -y
这里 subversion 及 apache 的版本并不要求很高, 所以直接用的源里的安装.
接下来安装 submin, 由于 submin 现在功能并不完善, 所以到网站上去下载最新版来安装,
这里查找最新版本, 在官网上也有详细的安装说明 http://supermind.nl/submin/nightly/
wget http://supermind.nl/submin/nightly/submin-2.0-dev-r1339.tar.gz
tar zxvf submin*
cd submin*
python setup.py install
这样 submin 已经安装好了, 我们等把 Trac 安装好后再对它进行配置.
安装 Trac
建义安装最新的稳定版,Trac 的官网地址:http://trac.edgewall.org/wiki/TracDownload
现在最新稳定版是 12.2.
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
easy_install Babel Genshi
wget http://ftp.edgewall.com/pub/trac/Trac-0.12.2.tar.gz
tar zxvf Trac*
cd Trac
python ./setup.py compile_catalog -f
python ./setup.py install
Trac 安装完成, 我们使用 submin 对它自动配置, 就不用再配置了.
配置 Submin
在配置前要规划一下, 配置文件放哪. 出于备份的方便, 我喜欢将网站目录等全部放在 /home 下一个目录里, 这样备份时, 打一个包就可以了.
mkdir -p /home/www/svn
mkdir -p /home/www/trac
chown -R www-data /home/www/svn
chown -R www-data /home/www/trac
我的规划是 /home/www/svn 放 subversion 文件.trac 放 trac env 放 submin 的配置文件
开始建立 Submin 环境:
submin2-admin /home/www/env initenv chendfy@gmail.com // 把配置文件放到 /home/www/env 下
然后会提示 Path to the repository? [svn]>/home/www/svn
subversion 的目录, 我们用 /home/www/svn
Path to the git repositories? [git]>
git 路径, 我们没装, 直接回车
Path to trac environment? [trac]> /home/www/trac
trac 的路径
Hostname? [dzsj]> svn.isfate.com
HTTP base? [/]> /
后面两项是网址及网址后缀, 后缀直址 / 就可以了. 最后提示
Apache file created: /home/www/env/conf/apache.cgi.conf
Please include this in your apache config. Also make sure that you have
the appropriate modules installed and enabled. Depending on your choices,
these may include: mod_dav_svn, mod_authz_svn, mod_wsgi, mod_dbd,
mod_authn_dbd and mod_python
Apache file created: /home/www/env/conf/apache.wsgi.conf
Please include this in your apache config. Also make sure that you have
the appropriate modules installed and enabled. Depending on your choices,
these may include: mod_dav_svn, mod_authz_svn, mod_wsgi, mod_dbd,
mod_authn_dbd and mod_python
Apache file created: /home/www/env/conf/apache.cgi.conf
需要我们在 APACHE 的配置文件中加入 /home/www/env/conf/apache.cgi.conf
找到 Apache 的配置文件, 在最后加入:Include /home/www/env/conf/apache.cgi.conf 保存
apache 需要开启两个模块:rewrite 还有 authn_dbd
a2enmod rewrite
a2enmod authn_dbd
重启 apache, 你就会现一切已经工作
在你的地址后加上 /trac 是 Trac 的地址 /svn 是 subversion 地址 /submin 是 submin 地址
附记: 由于在梦游的 VPS 上安装后会出现类似于缺少 python svn 模块之类的错误, 然后用 apt-cache search svn 试了试, 装了一大把有关 python 与 svn 相关的包. 后来居然能用了.
主要模块 python-subversion
apt-get install python-svn libsvn-dev libsvn-doc libsvn-perl libsvn1 python-subversion python-subversion-dbg