RHEL5下trac的安装配置

才发现好久没有写文章了 习惯不好

最近项目需要 又重新搭建了一套开发的周边环境

首先就是 版本控制, CI , 项目追踪等

其中trac的安装稍微麻烦点 下面记录了安装的过程

需要用到的包

apr

apr-util

apache

subversion

berkeley db

python2.5

mod_python

trac

安装python2.5.2
# ./configure --prefix=/usr/lib/python2.5
# make
# make install

# rm -rf /usr/bin/python
# ln -s /usr/lib/python2.5/bin/python /usr/bin/python
# ln -s /usr/lib/python2.5/bin/python2.5 /usr/bin/python2.5
安装setuptools
# sh ./setuptools-0.6c9-py2.5.egg

# ln -s /usr/lib/python2.5/bin/easy_install /usr/bin/easy_install
# ln -s /usr/lib/python2.5/bin/easy_install-2.5 /usr/bin/easy_install-2.5


安装Genshi和 Trac0.11.2.1
直接用setup-tools安装
# easy_install Genshi
# easy_install Trac

安装berkeley db
# cd build_unix/
# ../dist/configure
# make
# make install

安装apache
1.1 安装apr1.2.12
# ./configure --prefix=/usr/local/apr
# make ;make install

1.2 安装apr-util1.2.12(先安装好BerkeleyDB)
# ./configure --with-apr=/usr/local/apr --with-berkeley-db=/usr/local/BerkeleyDB.4.6/
# make;make install

1.3 安装apache2.2.8
# ./configure --prefix=/usr/local/apache2
--with-apr=/usr/local/apr/bin/apr-1-config
--with-apr-util=/usr/local/apr/bin/apu-1-config
--enable-so
--enable-dav
--enable-modules=so
--enable-maintainer-mode
--enable-proxy-balancer
--enable-proxy-http
--enable-proxy
--enable-modules=most
--enable-ssl
--enable-rewrite=shared
--enable-speling=shared

# make;make install

安装subversion1.4.6
1.1 解压subversion和deps包
删除apr和apr-utl
# ./configure --prefix=/usr/local/subversion
--with-apr=/usr/local/apr/bin/apr-1-config
--with-apr-util=/usr/local/apr/bin/apu-1-config
--with-apxs=/usr/local/apache2/bin/apxs
--with-berkeley-db=/usr/local/BerkeleyDB.4.6/
--with-ssl --with-zlib --enable-maintainer-mode

1.2
vi ./Makefile 修改makefile
old: SVN_APR_LIBS = .../subversion-1.4.2/apr/libapr-0.la -lrt -lm -
lcrypt -lnsl -lpthread -ldl
new: SVN_APR_LIBS = .../subversion-1.4.2/apr/libapr-0.la -lrt -lm -
lcrypt -lnsl -lpthread -ldl -lgssapi

1.3
# make;make install
# ln -s /usr/lib/libgssapi.so.2 /usr/lib/libgssapi.so
# make swig-py
# make install-swig-py
# ln -s /usr/local/subversion/bin/** /usr/bin/
增加python的svn支持
# cp -R /usr/local/subversion/lib/svn-python/svn/ /usr/lib/python2.5/lib/python2.5/site-packages/
# cp -R /usr/local/subversion/lib/svn-python/libsvn/ /usr/lib/python2.5/lib/python2.5/site-packages/

安装 mod_python-3.3.1
#./configure --with-apxs=/usr/local/apache2/bin/apxs
# make
# make install

调整apache
# emacs /etc/apache/httpd.conf
LoadModule python_module modules/mod_python.so
User www
Group www
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
#Deny from all
</Directory>
Include conf/extra/httpd-default.conf
Include conf/extra/httpd-vhosts.conf

# emacs /etc/apache/extra/httpd-vhosts.conf
<VirtualHost *:80>
#DocumentRoot
ServerName trac.xmhi.xmdev.com
<Location />
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /opt/tractest
PythonOption TracUriRoot /
</Location>
<Location /login>
AuthType Basic
AuthName "MyCompany Trac Server"
AuthUserFile /opt/tractest/.htpasswd
Require valid-user
</Location>
</VirtualHost>

# mkdir -p /opt/tractest




建立trac项目
# trac-admin /opt/tractest/ initenv


用户管理

用apache的工具创建密码

# htpasswd -c /opt/tractest/.htpasswd admin
# /usr/lib/python2.5/bin/trac-admin /opt/tractest/ permission add admin TRAC_ADMIN

# chown -R www:www /opt/tractest/

你可能感兴趣的:(RHEL)