Trac + Subversion + Mod_Python + Apache2 + PostgreSQL for RH

阅读更多

一、安装APACHE2

  1. #tar xvzf httd-2.0.55.tar.gz
  2. #cd httpd-2.0.55
  3. //安装APR和APR-UTIL
  4. #cd srclib/apr
  5. #./buildconf
  6. #./configure --prefix=/usr/local/apr
  7. #make && make install
  8. #cd ../apr-util
  9. #./buildconf
  10. #./configure –prefix=/usr/local/apr –with-apr=/usr/local/apr
  11. #make && make install
  12. #cd ../..
  13. #./configure --enable-dav --enable-maintainer-mode --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-mpm=worker --enable-track-vars --enable-cgi --enable-modules=so --enable-rewrite
  14. #make && make install

二、安装PostgreSQL
下载PostgreSQL FOR RHEL 4 RPM包,并安装(在RHEL 4的安装盘中有)
安装完后启动服务。

  1. #service postgresql start

新建数据库和用户

  1. #su - postgres
  2. $createdb jobc_trac
  3. $psql jobc_trac
  4. \create user jobc with password 'jobc';    //增加jobc用户,密码为jobc
  5. \alter user jobc with password 'jobc';    //修改jobc用户的密码为jobc
  6. \\q    //退出SQL环境

三、安装MYSQL、ORACLE等PHP环境
请参阅相关文章
ORACLE 10g for RHEL AS4 U2 x86_64 安装文档

四、安装PHP5

  1. #./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-libxml-dir --with-openssl --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-curlwrappers --enable-exif --enable-ftp --with-gettext --with-mysqli --with-oci8=/u01/oracle/10.2.0/db_1/ --enable-soap --enable-sockets --with-iconv --with-libdir=lib64 --with-gd --with-jpeg-dir --with-png-dir --with-mysql --enable-xslt --with-xslt-sablot=/usr/local/sablot/lib --prefix=/usr/local/php5 --sysconfdir=/etc --with-pgsql
  2. #make && make install
  3.  
  4. 修改httpd.conf文件
  5. 加入
  6. LoadModule php5_module modules/libphp5.so
  7.  
  8. AddType application/x-httpd-php .php .php3 .inc
  9. AddType application/x-httpd-php-source .phps

五、安装SWIG

  1. #tar -xzvf swig-1.3.27.tar.gz
  2. #cd swig-1.3.27
  3. #./configure --with-python=/usr/bin/python
  4. #make && make install

六、安装SUBVERSION

  1. #tar -xzvf subversion-1.3.0.tar.gz
  2. #cd subversion-1.3.0
  3. #./configure --with-apxs=/usr/local/apache2/bin/apxs --with-swig=/usr/local/ --prefix=/usr/local/subversion
  4. #make && make install
  5. #make swig-py && make install-swig-py
  6. #ldconfig

七、安装cleansilver

  1. #tar -xzvf clearsilver-0.10.2.tar.gz
  2. #cd clearsilver-0.10.2
  3. #./configure
  4. #make && make install
  5. #cd python
  6. #python setup.py install

该步骤python setup.py install如果失败(或有错误),则将该目录下的neo_cgi.so复制到PYTHON目录中
或执行以下命令

  1. #cp neo_cgi.so /usr/lib/python2.3/site-packages

八、安装mod_python

  1. #tar -xzvf mod_python-3.1.4.tgz.gz
  2. #./configure --with-apxs=/usr/local/apache2/bin/apxs
  3. #make && make install
  4. #make install_dso
  5. #make install_py_lib

九、安装Trac

  1. #tar -xzvf trac-0.9.3.tar.gz
  2. #cd trac-0.9.3
  3. #python ./setup.py install
  4.  
  5. #ln -s /usr/local/subversion/lib/svn-python/svn/ /usr/lib/python2.3/site-packages/svn
  6.  
  7. #ln -s /usr/local/subversion/lib/svn-python/libsvn/ /usr/lib/python2.3/site-packages/libsvn
  8.  
  9. #ln -s /usr/local/subversion/lib/svn-python /usr/lib/python2.3/site-packages/svn-python

十、配置
初始化项目

  1. trac-admin /somedir/trac/project_name initenv

Apache2配置
httpd.conf

  1.     DocumentRoot /var/trac/myproject
  2.     ServerName trac.mycompany.com
  3.     
  4.         SetHandler mod_python
  5.         PythonHandler trac.web.modpython_frontend
  6.         PythonOption TracEnv /var/trac/myproject
  7.         PythonOption TracUriRoot /
  8.     
  9.     
  10.         AuthType Basic
  11.         AuthName "MyCompany Trac Server"
  12.         AuthUserFile /var/trac/myproject/.htusers
  13.         Require valid-user
  14.     

你可能感兴趣的:(Python,subversion,PostgreSQL,SVN,Oracle)