ubuntu/debian中Subversion 与TRAC Submin的安装与中文化

2,982次阅读
没有评论

使用安装源的方式安装安装必要的依赖库及相关软件:

apt-get update
apt-get install subversion libapache2-svn libapache2-mod-python libapache2-mod-python-doc -y
a2enmod re*
/etc/init.d/apache2 restart

这样就已经将subversion安装好了,不须要配置其它的,因为我会用submin来自动配置,接下来安装submin:

修改 /etc/apt/sources.list 在文件最后增加
“deb http://debian.supermind.nl/ current main”(去掉”符号)
再运行

wget -q -O - http://supermind.nl/debian.key | apt-key add -
apt-get update
apt-get install submin
submin-admin create default

之后会得到如下提示:

Apache files created:
/etc/submin/default-apache-wsgi.conf
/etc/submin/default-apache-cgi.conf
Please include one of these in your apache config. Also make sure that
you have mod_dav_svn and mod_authz_svn enabled.

意思是说选择一个配置文件,加入到 apache 的conf文件里
然后我们编辑/etc/apache2/apache2.conf这个文件,在文件的最后增加

Include /etc/submin/default-apache-cgi.conf

接下来对submin进行配置:
修改修改/etc/submin/default.conf 内容如下:

[svn]
authz_file = /home/www/svn/note/authz
userprop_file = /home/www/svn/note/userproperties.conf #这几个文件须要手动从/var/lib/submin目录中复制到我们指定的目录
access_file = /home/www/svn/note/htpasswd
repositories = /home/www/svn/proj
[www]
base_url = /submin
svn_base_url = /svn
trac_base_url = /trac
[trac]
enabled = True
basedir = /home/www/svn/trac
[backend]
bindir = /usr/share/submin/bin
path = /bin:/usr/bin:/usr/local/bin:/opt/local/bin
[generated]
session_salt = GBtTU2S8nX8KGOyC

再修改/etc/submin/default-apache-cgi.conf

Alias /submin /usr/share/submin/www
<Directory /usr/share/submin/www>
 Order allow,deny
 Allow from all
 Options ExecCGI FollowSymLinks
 AddHandler cgi-script py cgi pl
 SetEnv SUBMIN_CONF /etc/submin/default.conf
 RewriteEngine on
 RewriteBase /submin
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.+)$ submin.cgi/$1
 RewriteRule ^/?$ submin.cgi/
 </Directory>
 <Location /svn>
 DAV svn
 SVNParentPath /home/www/svn/proj
 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /home/www/svn/note/htpasswd
 AuthzSVNAccessFile /home/www/svn/note/authz
 Satisfy Any
 Require valid-user
 </Location>

注意,须要在SSH中手动建立上面出现的路径,并且它的所有都为apache(www-data)
更改所有者的方法为: chown -R www-data /home/www

最后安装TRAC:
Babel Genshi依赖库的安装

wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
easy_install Babel Genshi

下载trac源码编译安装:现在最新的是0.12.2,

wget ttp://ftp.edgewall.com/pub/trac/Trac-0.12.2.tar.gz
python ./setup.py compile_catalog -f
python ./setup.py install

trac也就安装完成了,接下来稍微配置一下,实际上只是增加了一个apache的网站指向到trac而已,让用户能访问到trac.
新建一个trac文件,放到/etc/apache2/sites-available,

<Location /trac>
 SetHandler mod_python
 PythonInterpreter main_interpreter
 PythonHandler trac.web.modpython_frontend
 PythonOption TracEnvParentDir /home/www/svn/trac
 PythonOption TracUriRoot /trac
 </Location>
 <LocationMatch "/trac/[^/]+/login">
 AuthType Basic
 AuthName "Trac"
 AuthUserFile /home/www/svn/note/htpasswd
 Require valid-user
 </LocationMatch>

然后运行

a2ensite trac
/etc/init.d/apache2 restart

就OK了

正文完
 0
评论(没有评论)