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