一直覺得缺少一個管理文檔,積累知識的軟體。最近偶然發現了Trac和Redmine,安裝一下看看,是否真如網上說的那麼強大。期盼中。。。^_^
先google上搜了一堆安裝說明,down下來備查。
1.系統:
我的系統安裝的是rhel-server-5.5
核心版本:Linux version 2.6.18-164.el5
2.安裝:
2.1 Apache:之前已安裝
2.2 Swig: 之前已安裝1.3.29
我們再安裝Subversion時檢視一下是否已安裝swig,如果沒有安裝則必須先安裝swig
#which swig
/usr/bin/swig
#/usr/bin/swig -version
2.3 Subversion:之前已經安裝
#./configure --with-apxs=/usr/local/apache2/bin/apxs --prefix=/usr/local/subversion --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 --with-ssl --with-zlib=/usr/lib --enable-maintainer-mode --without-berkeley-db PYTHON=/usr/bin/python --with-swig=/usr/lbin/swig --enable-shared --enable-static --enable-swig-binding=python
#make
#make install
2.4 swig-py:
安裝完成subverison後,進入subverison編譯目錄執行:
#make swig-py
#make check-swig-py
#make install-swig-py
#echo /usr/local/subversion/lib/svn-python > /usr/lib/python2.4/site-packages/subversion.pth
測試svn的swig-py包是不是正常
#python
>>>import svn.repos //按 ctrl+d退出,如果不報錯,那就說明 OK了 .如果報錯,那麼檢查如下問題: I. subversion的 configure是不是 enable了 shared和 static,是不是帶 --with-swig; II. libsvn_swig_py-x.so是否存在于 /usr/local/subversion/lib目錄; III. /usr/local/subversion/lib是否已經增加到 ld.so.conf檔案 (/etc/ld.so.conf) IV. 請使用 ldconfig -v |grep swig來檢查是否有 swig的下列動态庫 libsvn_swig_py-1.so.0 -> libsvn_swig_py-1.so.0.0.0
2.5 Python:
http://www.python.org/ 官網上Python2的最新版本是2.7.1, 由于作業系統安裝時已經安裝了2.4.3是以就暫用它。
Setuptools:
wget -q http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
安裝完setuptools之後就可以使用easy_install來安裝Python庫了。
2.6 Genshi:
easy_install Genshi
不幸的是easy_install Genshi失敗了:
# easy_install Genshi
Searching for GenshiReading http://pypi.python.org/simple/Genshi/Reading http://genshi.edgewall.org/Reading http://genshi.edgewall.org/wiki/DownloadBest match: Genshi 0.6Downloading http://ftp.edgewall.com/pub/genshi/Genshi-0.6-py2.4.eggerror: Can't download http://ftp.edgewall.com/pub/genshi/Genshi-0.6-py2.4.egg: 404 Not Found
沒辦法,隻能去http://genshi.edgewall.org/wiki/Download 下載下傳了Genshi-0.6-py2.4.egg
.egg是Python安裝檔案的字尾名,可以使用easy_install安裝,如:
# easy_install Genshi-0.6-py2.4.egg
2.7 pysqlite:
資料庫支援,暫時使用SQLite, 下載下傳位址http://code.google.com/p/pysqlite/downloads/list
#easy_install pysqlite
(發現伺服器上SQLite version 3.3.6)
2.8 Trac-0.12.2.tar.gz: 目前的穩定版本 http://trac.edgewall.org/wiki/TracDownload
#python ./setup.py install
clearsilver-0.10.5.tar.gz: 官方下載下傳位址 http://www.clearsilver.net/downloads/
#tar xvfz clearsilver-0.10.5.tar.gz
#cd clearsilver-0.10.5
#./configure --with-python=/usr/bin/python --prefix=/usr/local --disable-ruby --disable-java --disable-pache --disable-csharp --disable-perl
#make
#make install
#cd python
#python setup.py build
#python setup.py install
2.9 mod_wsgi:
官網推薦mod_wsgi,因為mod_python項目已經dead了, 下載下傳版本mod_wsgi-3.0
#./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python=/usr/bin/python
#make
#make install
生成的mod_wsgi.so會自動複制到/usr/local/apache2/modules
3.配置:
配置Apache:
用vim打開/usr/local/apache2/conf/httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
AddType text/html .py
配置Trac:
參考INSTALL說明,先配置環境目錄。/home/tracroot
#trac-admin /home/tracroot initenv
Project Name [My Project]> test
Database connection string [sqlite:db/trac.db]>
運作背景web伺服器,暫時使用tracd:
#tracd --port 8000 /home/test