fswdnr 发表于 2016-11-20 12:29:14

Trac + Subversion + Mod_Python + Apache2 + PostgreSQL for RH

  一、安装APACHE2

[*]#tar xvzf httd-2.0.55.tar.gz
[*]#cd httpd-2.0.55
[*]//安装APR和APR-UTIL
[*]#cd srclib/apr
[*]#./buildconf
[*]#./configure --prefix=/usr/local/apr
[*]#make && make install
[*]#cd ../apr-util
[*]#./buildconf
[*]#./configure –prefix=/usr/local/apr –with-apr=/usr/local/apr
[*]#make && make install
[*]#cd ../..
[*]#./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
[*]#make && make install

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

[*]#service postgresql start

  新建数据库和用户

[*]#su - postgres
[*]$createdb jobc_trac
[*]$psql jobc_trac
[*]\create user jobc with password 'jobc';    //增加jobc用户,密码为jobc
[*]\alter user jobc with password 'jobc';    //修改jobc用户的密码为jobc
[*]\\q    //退出SQL环境

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

[*]#./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
[*]#make && make install
[*] 
[*]修改httpd.conf文件
[*]加入
[*]LoadModule php5_module modules/libphp5.so
[*] 
[*]AddType application/x-httpd-php .php .php3 .inc
[*]AddType application/x-httpd-php-source .phps

  五、安装SWIG

[*]#tar -xzvf swig-1.3.27.tar.gz
[*]#cd swig-1.3.27
[*]#./configure --with-python=/usr/bin/python
[*]#make && make install

  六、安装SUBVERSION

[*]#tar -xzvf subversion-1.3.0.tar.gz
[*]#cd subversion-1.3.0
[*]#./configure --with-apxs=/usr/local/apache2/bin/apxs --with-swig=/usr/local/ --prefix=/usr/local/subversion
[*]#make && make install
[*]#make swig-py && make install-swig-py
[*]#ldconfig

  七、安装cleansilver

[*]#tar -xzvf clearsilver-0.10.2.tar.gz
[*]#cd clearsilver-0.10.2
[*]#./configure
[*]#make && make install
[*]#cd python
[*]#python setup.py install

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

[*]#cp neo_cgi.so /usr/lib/python2.3/site-packages

  八、安装mod_python

[*]#tar -xzvf mod_python-3.1.4.tgz.gz
[*]#./configure --with-apxs=/usr/local/apache2/bin/apxs
[*]#make && make install
[*]#make install_dso
[*]#make install_py_lib

  九、安装Trac

[*]#tar -xzvf trac-0.9.3.tar.gz
[*]#cd trac-0.9.3
[*]#python ./setup.py install
[*] 
[*]#ln -s /usr/local/subversion/lib/svn-python/svn/ /usr/lib/python2.3/site-packages/svn
[*] 
[*]#ln -s /usr/local/subversion/lib/svn-python/libsvn/ /usr/lib/python2.3/site-packages/libsvn
[*] 
[*]#ln -s /usr/local/subversion/lib/svn-python /usr/lib/python2.3/site-packages/svn-python

  十、配置
初始化项目

[*]trac-admin /somedir/trac/project_name initenv

  Apache2配置
httpd.conf

[*]<virtualhost * >
[*]    DocumentRoot /var/trac/myproject
[*]    ServerName trac.mycompany.com
[*]    <location />
[*]        SetHandler mod_python
[*]        PythonHandler trac.web.modpython_frontend
[*]        PythonOption TracEnv /var/trac/myproject
[*]        PythonOption TracUriRoot /
[*]    
[*]    <location /login>
[*]        AuthType Basic
[*]        AuthName "MyCompany Trac Server"
[*]        AuthUserFile /var/trac/myproject/.htusers
[*]        Require valid-user
[*]    </location>
[*]</virtualhost>
页: [1]
查看完整版本: Trac + Subversion + Mod_Python + Apache2 + PostgreSQL for RH