linux下安装Trac

    技术2022-05-20  35

    一直觉得缺少一个管理文档,积累知识的软件。最近偶然发现了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

     

    测试svnswig-py包是不是正常

    #python

    >>>import svn.repos             //ctrl+d退出,如果不报错,那就说明 OK.如果报错,那么检查如下问题:   I. subversionconfigure是不是 enablesharedstatic,是不是带 --with-swigII. 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

     

     

     

     

     


    最新回复(0)