trac + SVN + apache(SSL) 安装
1. 简介:
由于项目需求,所以要部署一台Trac并且和现有的SVN整合. 至于什么是Trac和SVN,就不多介绍了.
2. 安装步骤:
(1) 安装apache(此步骤略)
(2) 安装SVN
shell > wget http://subversion.tigris.org/downloads/subversion-1.5.6.tar.gz
shell > tar zxvf subversion-1.5.6.tar.gz
shell > cd subversion
shell > ./configure –with-apxs=/usr/local/apache/bin/apxs –prefix=/usr/local/svn –with-apr=/usr/local/apache –with-apr-util=/usr/local/apache –with-
ssl –enable-maintainer-mode –without-berkeley-db PYTHON=/usr/bin/python –with-swig=/usr/bin/swig –enable-shared –enable-static –enable-swig-
binding=python
shell > make && make install
(3) 配置apache:
创建证书:
shell > maker /usr/local/apache/conf/key
shell > cd /usr/local/apache/conf/key
shell > openssl genrsa -out xuan-lu.key 1024
shell > chmod 600 /usr/local/apache/key/xuan-lu.key
shell > openssl req -new -key xuan-lu.key -out xuan-lu.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [GB]:CN
State or Province Name (full name) [Berkshire]:China
Locality Name (eg, city) [Newbury]:Shang Hai
Organization Name (eg, company) [My Company Ltd]:99 Roses
Organizational Unit Name (eg, section) []:99 Roses
Common Name (eg, your name or your server’s hostname) []:xuan-lu
Email Address []:martin@xuan-lu.net
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:xuan-lu
An optional company name []:xuan-lu
shell > openssl x509 -req -days 365 -in xuan-lu.csr -signkey xuan-lu.key -out xuan-lu.crt
shell > ls
xuan-lu.crt xuan-lu.csr xuan-lu.key
配置apache:
shell > /usr/local/apache/bin/htpasswd -c /home/svn/user/svn_user.conf martin
New password:
Re-type new password:
Adding password for user martin
shell > vi /usr/local/apache/conf/httpd.conf
取消对下的ssl的注释:
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf
shell > vi /usr/local/apache/conf/extra/httpd-ssl.conf
添加如下:
<VirtualHost *:443>
ServerName svn.xuan-lu.net
SSLEngine on
SSLCertificateFile "/usr/local/apache/key/xuan-lu.crt"
SSLCertificateKeyFile "/usr/local/apache/key/xuan-lu.key"
<Location />
DAV svn
SVNPath /home/svn/xuan-lu/
AuthType Basic
AuthName "xuan-lu!!! SVN"
AuthUserFile /home/svn/user/svn_user.conf
AuthzSVNAccessFile /home/svn/xuan-lu/conf/authz
Require valid-user
</Location>
</VirtualHost>
shell > service httpd restart
注: 解释下SVN 的权限配置文件的使用
[groups]
admin = martin
user_r = user_1
user_rw = user_2
[/]
* =
@admin = rw
[/xuan-lu]
@user_r = r
@user_rw = rw
用户分别分为admin,user_r和user_rw三个组,其中只有admin组用户对/(根)目录有读写权限,组user_r对/99rose目录仅仅有读的权限,而组user_rw对/xuan-lu目录具备读写
的权限.根据不同的需求可以定制不同的权限,这里不多做介绍.
(2) 安装trac
shell > cd /home/tools/subversion (个人习惯在/home/目录下创建一个tools目录用来放置源码包)
shell > make swig-py
shell > make install-swig-py
shell > echo /usr/local/svn/lib/svn-python > /usr/lib/python2.4/site-packages/subversion.pth
验证svn-python (没报错即可)
shell > python
>>>import svn.repos
>>>
shell > cd /home/tools/
shell > wget http://ftp.edgewall.com/pub/trac/Trac-0.11.5.tar.gz
shell > tar zxvf Trac-0.11.5.tar.gz
shell > cd Trac-0.11.5
shell > wget http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c9-py2.4.egg#md5=260a2be2e5388d66bdaee06abec6342a
shell > sh setuptools-0.6c9-py2.4.egg
shell > python ./setup.py install
生成 trac
shell > trac-admin /home/svn/trac_xuan-lu initenv
Creating a new Trac environment at /home/svn/trac_xuan-lu
Trac will first ask a few questions about your environment
in order to initialize and prepare the project database.
Please enter the name of your project.
This name will be used in page titles and descriptions.
Project Name [My Project]> 99 Roses !!!
Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).
Database connection string [sqlite:db/trac.db]>
Please specify the type of version control system,
By default, it will be svn.
If you don’t want to use Trac with version control integration,
choose the default here and don’t specify a repository directory.
in the next question.
Repository type [svn]>
Please specify the absolute path to the version control
repository, or leave it blank to use Trac without a repository.
You can also set the repository location later.
Path to repository [/path/to/repos]> /home/svn/xuan-lu
… …
配置Apache( 安装mod_python 以及配置 trac)
shell > cd /home/tools/
shell > wget http://apache.freelamp.com/httpd/modpython/mod_python-3.3.1.tgz
shell > ./configure –with-apxs=/usr/local/apache/bin/apxs
shell > vi vi src/connobject.c
… …
141 while ((bytes_read < len || len == 0) &&
142 !(b == APR_BRIGADE_SENTINEL(bb) ||
143 APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b))) {
… …
修改142行为上所示(原为 !(b == APR_BRIGADE_SENTINEL(b) || )
否则会报如下错误:
… …
connobject.c:142: error: request for member ……in something not a structure or union
apxs:Error: Command failed with rc=65536
.
make[1]: *** [mod_python.so] Error 1
make[1]: Leaving directory `/home/tools/mod_python-3.3.1/src’
make: *** [do_dso] Error 2
shell > make && make install
shell > vi /usr/local/apache/conf/httpd.conf
… …
LoadModule python_module modules/mod_python.so
… …
配置虚拟主机:
shell > vi /usr/local/apache/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot /home/svn/trac_xuan-lu
ServerName trac.xuan-lu.net
<Location "/">
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /home/svn/trac_xuan-lu
PythonOption TracUriRoot /
AuthType Basic
AuthName "xuan-luTrac Server"
AuthUserFile /home/svn/user/svn_user.conf
Require valid-user
</Location>
<Directory "/home/svn/trac_xuan-lu">
AllowOverride All
Order Deny,Allow
</Directory>
</VirtualHost>
打开IE 输入:http://trac.xuan-lu.net 验证是否存在问题
到此为止 trac 和 apache 以及 SVN 的整合 已经结束 下面将介绍一些简单的修改.
1. 开启trac 的webadmin功能:
shell > vi /home/svn/trac_xuan-lu/conf/trac.ini
在配置文件结尾加上
[components]
webadmin.* = enabled
给予martin 用户 webadmin 权限:
shell > trac-admin /home/svn/trac_xuan-lu/
Welcome to trac-admin 0.11.5
Interactive Trac administration console.
Copyright (c) 2003-2009 Edgewall Software
Type: ‘?’ or ‘help’ for help on commands.
Trac [/home/svn/trac_xuan-lu]> permission add martin TRAC_ADMIN
Trac [/home/svn/trac_xuan-lu]>
刷新页面用martin用户登录,就会发现,多了admin选项
2. 更改trac左上方的logo
shell > vi /home/svn/trac_xuan-lu/conf/trac.ini
… …
[header_logo]
alt = (please configure the [header_logo] section in trac.ini)
height = -1
link = /
src = http://www.xuan-lu.net/logo.jpg
width = -1
… …
3. Trac整合SVN用户权限:
shell > vi /home/svn/trac_xuan-lu/conf/trac.ini
… …
[trac]
authz_file = /home/svn/xuan-lu/conf/authz
authz_module_name = xuan-lu
… …
4. 解决trac中SVN源文件乱码问题:
shell >
… …
[trac]
default_charset = utf-8 (原来为:iso-8859-15)
… …
6. 用户权限配置:
(1) 使用martin登录
(2) 选择admin
(3) 选择左侧:Permissions选项
(4) 可以看到配置用户的权限选项了(界面的右侧)
权限根据自己实际需求去进行操作:
BROWSER_VIEW # 查看版本库
CHANGESET_VIEW # 查看修改记录
FILE_VIEW # 查看文件内容
LOG_VIEW # 查看日志
MILESTONE_VIEW # 查看里程杯
REPORT_SQL_VIEW # 查看报告查询语句
REPORT_VIEW # 查看报告
ROADMAP_VIEW # 查看路标
SEARCH_VIEW # 显示查找
TICKET_CREATE # 创建任务单
TICKET_MODIFY # 修改任务单
TICKET_VIEW # 显示任务单
TIMELINE_VIEW # 查看时间
WIKI_CREATE # 创建wiki
WIKI_MODIFY # 修改wiki
WIKI_VIEW # 查看wiki
分享到:
相关推荐
svn+apache+trac配置 svn+apache+trac配置 svn+apache+trac配置 svn+apache+trac配置
安装Trac+SVN+Apache过程的详细记录。解决像我一样的初学者初次安装的难题,高手就表看了...
SVN+Trac+Apache的配置文件
windows下Apache+SVN+Trac安装及配置(一)
Windows 平台下Trac+apache+mysql+svn集成
redhat下搭建 SVN+Apache+Trac软件开发环境安装配置文档。支持包安装及配置命令手册。
Apache+Trac+SVN安装测试指导
Apache+Trac配置Apache+Trac配置Apache+Trac配置
这几天一直在尝试着配置一个windows下的bug跟踪工具,最终选择了使用trac+svn,其中的问题还真不少,经过几天的辛苦摸索和借鉴csdn上前辈们的经验,终于搭建起来了,这里将详细的解决方法分享给大家。 个人感觉就是...
最近花了好大力气才将trac系统搭建成功,为了以后的朋友不用再花费这么多时间跟精力,现将其分享。其中包括详细的配置说明和相关的所有软件,还有svn和apache的基本配置说明。
很久以来就有的想法,给我们的产品开发...使用过vss,虽说简洁,但功能不完善而且有很多小BUG,所以放弃,在次研究Trac,发现Trac非常符合我的要求:免费、开源、跨平台、轻量级、高度可扩展,下面介绍下svn+trac的配置
SVN+Trac安装笔记
Apache2.0.X+SVN1.4.X+Trac0.11dev安装与配置详解!
Apache+SVN+Trac搭建项目管理服务器的安装与配置详解
SVN + Trac + Apache 完整安裝攻略
SVN+Trac的配置笔记
windows下 Apache、SVN、Trac的集成安装, 并且进行域帐号集成验证
Apache+svn+trac安装笔记
本文档主要讲解了trac如何配合svn的安装配置。经过本人的实践所写,绝对可以让trac管理页面成功运行,希望对下载人员有帮助。