1.下载Trac安装包并解压
wget http://download.edgewall.org/trac/Trac-1.0.tar.gz
tar xvf Trac-1.0.tar.gz
cd Trac-1.0
2.解开之后查看一下其中的INSTALL文件,其中的Requirements一节详细列出了安装Trac所必须的软件:
Python >= 2.5。(CentOS 5.5不符合要求需要升级python)
Genshi >= 0.6。(在与Trac同一个网站上有下载)
可选的subversion >= 1.0(推荐>=1.1.x)和subversion的SWIG Python绑定
PySQLite,需要用于SQLite 3.x版本的PySQLite 2.x版
可运行python或CGI的Web服务器
接下来就先解决这些前提条件
yum install -y wget curl curl-devel unzip ncurses-devel libxml2-devel openssl-devel libjpeg-devel libpng-devel freetype-de
vel autoconf automake libtool gcc gcc-c++ flex bison vim-enhanced python-devel pcre pcre-devel zlib zlib-devel libevent li
bevent-devel libtool-libs libtool-ltdl libtool-ltdl-devel bzip2 bzip2-devel gdb e2fsprogs-devel
安装sqlite 3
yum install -y sqlite sqlite-devel
安装subversion
yum install -y subversion subversion-devel
安装python2.7
wget http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgz
tar xvf Python-2.7.1.tgz
cd Python-2.7.1
./configure --enable-shared //一定要加上--enable-shared参数,否则下面装mod_python会报错
make && make install
echo '/usr/local/lib' >> /etc/ld.so.conf && ldconfig
安装python setuptools-0.6
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar xvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py install
安装Genshi
wget http://ftp.edgewall.com/pub/genshi/Genshi-0.6.tar.gz
tar xvf Genshi-0.6.tar.gz
cd Genshi-0.6
python setup.py install
安装PySQLite 2.x
wget http://pysqlite.googlecode.com/files/pysqlite-2.6.3.tar.gz
tar xvf pysqlite-2.6.3.tar.gz
cd pysqlite-2.6.3
python setup.py install
安装apache
wget http://archive.apache.org/dist/httpd/httpd-2.2.17.tar.gz
tar xvf httpd-2.2.17.tar.gz
cd cd httpd-2.2.17
./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --enable-proxy --enable-ssl --with-ssl
make && make install
vi /usr/local/apache/conf/httpd.conf
修改apache以apache用户和apache用户组运行
安装mod_python-3.3.1(apache的python模块)
wget http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz
tar xvf mod_python-3.3.1.tgz
cd mod_python-3.3.1
./configure --with-apxs=/usr/local/apache/bin/apxs --with-python=/usr/local/bin/python --with-max-locks=32 --with-flex=/usr/bin/flex
make && make install
echo 'LoadModule python_module modules/mod_python.so' >>/usr/local/apache/conf/httpd.conf