日期:2014-05-16  浏览次数:20676 次

Linux下Trac的安装

?

1. 下载 Trac-0.12.1.tar.gz

?从? http://trac.edgewall.org/wiki/TracDownload? 下载,解压:

$ tar xzvf Trac-0.12.1.tar.gz

?

查看INSTALL文件:


?*1)??Python, version >= 2.4.? (Python >= 2.4 ,下面以Python2.7为例,Python3好像有问题,setuptools安装不兼容)
?* 2)?? setuptools, version >= 0.6
?* 3)?Genshi, version >= 0.6
?* 4)?Subversion可选? Optionally, Subversion, version >= 1.1.x and the Subversion SWIG Python
?? bindings (not PySVN, that's something different).???

* 5)? 数据库支持:使用MySQL DB (根据需要选择)

?? One of the following Python bindings, depending on the database used:?
??? * pysqlite version 2.x for SQLite 3.x (is part of the standard library
????? starting with Python 2.5)
??? * psycopg2 version 2.0.x for the PostgreSQL database
??? * MySQLdb, version 1.2.2 for the MySQL database
?*6)? WebServer?可选,也可以单独运行一个Server

? ?A web server capable of executing CGI/FastCGI scripts, or Apache HTTPD with
?? mod_python or mod_wsgi. (Trac also comes with a standalone server, tracd)

?

?

2.?Install Python?

?下面以Python2.7为例,Python3好像有问题,setuptools安装不兼容。

从此处下载Python2.7?? http://www.xdowns.com/soft/softdown.asp?softid=62353

#bzip2 -d Python-2.7.tar.bz2 
#tar -vxf Python-2.7.tar
#cd Python-2.7
#./configure --enable-shared; 
#make; make install;
#/usr/local/bin/python2.7 -V

"--enable-shared " 为了生成动态库,64位linux下安装 modwsgi 需要。

?

3. install setuptools

下载http://pypi.python.org/pypi/setuptools#downloads;

?

#sh setuptools-0.6c11-py2.7.egg 

?
提示 Finished processing dependencies for setuptools==0.6c11

?

4. Genshi install


???下载地址: http://genshi.edgewall.org/wiki/Download

?

$ wget http://ftp.edgewall.com/pub/genshi/Genshi-0.6.tar.gz
$ tar xzvf Genshi-0.6.tar.gz
$ cd Genshi-0.6
$ su
# python2.7 setup.py install
# exit

?

5.MySQL-python install


下载地址: http://pypi.python.org/pypi/MySQL-python/


#tar -vxzf MySQL-python-1.2.3.tar.gz
#cd MySQL-python-1.2.3
#python2.7 setup.py install

?

6. Trac- install

?

#cd  Trac-0.12.1
#python2.7 setup.py install

?
最后提示 Finished processing dependencies for Trac==0.12.1


?7. 暂时以StandAlone来启动

?

$mkdir /home/zliu/hello
$trac-admin /home/zliu/hello initenv

提示Project名称和Database connection string,数据库连接字符串输入(此处数据库trac提前建好):

mysql://zliu:123456@localhost:3306/trac???

?

8. ?启动Server

?$tracd --port 8000 /home/zliu/hello

?

访问:http://localhost:8000/hello

?

??? 可以看到:

Welcome to Trac 0.12.1?

?

跟svn,Apache 结合 待研究...

?

9. 与Apache结合

?

?采用modwsgi,参考 http://code.google.com/p/modwsgi/wiki/InstallationIssues

?

?

参考文档:

http://trac.edgewall.org/wiki/TracInstall

http://tech.idv2.com/2008/12/26/install-trac-on-linux/

http://www.makenotes.net/?p=149001

http://trac.edgewall.org/wiki/TracEnvironment

?