沫沫兜 发表于 2013-1-31 00:43:43

Linux (CentOS) 安装 Trac 及相关

找到了Trac,用来进行对项目以及源码及TimeLine的一些管理:

1.准备

Server : Linux (CentOS)

Package:

必须的:
python.x86_64.2.4.3-46.el5_8.2 (yum服务器直接安装)


>> setuptools-0.6c9-py2.4.egg
>> Trac-0.12.3.tar.gz
>> Genshi-0.6.tar.gz

>> mod_python-3.3.1.tar.gz
>> MySQL-python.x86_64.1.2.3-0.1.c1.el5


2.开始安装

a.因为Trac中可能需要用到setuptools所以,需要先安装setuptools.在这里,我们已经安装好了python,

eg: <直接从yum服务器安装,如果不是CentOS,可以选择去下载相应的源码包,或可执行文件>

# yum install python


b.安装Genshi & setuptools
# sh setuptools-0.6c9-py2.4.egg# tar xvf Genshi-0.6.tar.gz# cd Genshi-0.6# python setup.py install

c.安装Trac
# tar xvf Trac-0.12.3.tar.gz# cd Trac-0.12.3# python setup.py install

d.安装mod_python & MySQL_python
# tar xvf mod_python-3.3.1.tar# cd mod_python-3.3.1# ./configure --with-apxs=/opt/httpd/bin/apxs --with-python=/usr/bin/python2.4/** 到这一步的时候可能会出现一个问题,尝试编译时不成功,有可能是由于python的版本与trac的版本之间存在差异,不允许通过。这时候我们可以# vim src/connobject.c找到第142行:将:!(b == APR_BRIGADE_SENTINEL(b) ||换成:      !(b == APR_BRIGADE_SENTINEL(bb) ||*/然后正常编译,成功后:makemake install

e.完成mod_python安装后
可以在apache的httpd.conf中添加
LoadModule python_module modules/mod_python.so

并添加一台虚拟机:
<VirtualHost *:80>
    DocumentRoot /data/httpd/htdocs/trac.imuo.cn
    ServerName trac.imuo.cn
    ServerAdmin webmaster@imuo.cn
    ServerAlias trac.imuo.cn

    <Location "/trac">
      SetHandler mod_python
      PythonInterpreter main_interpreter
      PythonHandler trac.web.modpython_frontend
      PythonOption TracEnv /data/httpd/htdocs/trac.imuo.cn
      PythonOption TracUriRoot /trac
      #AuthType Basic
      #AuthName "Intop Trac Server"
      #AuthUserFile
      #/data/httpd/htdocs/trac.imuo.cn/.htpasswd
      #Require valid-user
    </Location>
</VirtualHost>

Auth部分暂时还没有进行测试,先屏蔽。

f.安装MySQL-python
这个下载的tar包不能很好的编译与安装。所以我个人是使用的yum
# yum install MySQL-python/**使用yum时,需要注意MySQL的写法。不然有可能找不到*/


2.检测
如果是在本机上面安装的Trac,则在Trac安装完成后,可以先使用一个初始化
# trac-admin /path/name initenv/** 这个 path-name 需要对应上面虚拟机的 PythonOption TracEnv /data/httpd/htdocs/trac.imuo.cn*/

输入正确的path-name后,我们在init时,可以输入一些项目的名称及你个人选用的DB
比如在输入选择DB时。

mysql://name:password@host/dbname
页: [1]
查看完整版本: Linux (CentOS) 安装 Trac 及相关