事前準備インストール
[root@localhost ~]# yum install gcc // for apache ○
[root@localhost ~]# yum install zlib-devel // for apache ○
[root@localhost ~]# yum install openssl-devel // for apached △
[root@localhost ~]# yum install libtool // for apache ○
[root@localhost ~]# yum update perl // for apache △
[root@localhost ~]# yum install gcc-c++ // for swig ○
[root@localhost ~]# yum install expat-devel // for subversion ○
[root@localhost ~]# yum install sqlite-devel // for python ○
Apacheインストール
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget http://ftp.kddilabs.jp/infosystems/apache/httpd/httpd-2.2.16.tar.gz
[root@localhost src]# tar -vxzf httpd-2.2.16.tar.gz
[root@localhost src]# cd httpd-2.2.16
[root@localhost httpd-2.2.16]# ./configure --prefix=/usr/local/apache2 --enable-dav --enable-so --enable-ssl --with-perl --enable-mods-shared=all
[root@localhost httpd-2.2.16]# make
[root@localhost httpd-2.2.16]# make install
// Installed python version can be checked with the following commands
Pythonインストール
[root@localhost httpd-2.2.16]# cd /usr/local/src
[root@localhost src]# wget http://www.python.org/ftp/python/2.6/Python-2.6.tgz
[root@localhost src]# tar -zxvf Python-2.6.tgz
[root@localhost src]# cd Python-2.6
[root@localhost Python-2.6]# ./configure --prefix=/usr/local/python2.6
[root@localhost Python-2.6]# make
[root@localhost Python-2.6]# make install
// Installed python version can be checked with the following commands
[root@localhost Python-2.6]# /usr/local/python2.6/bin/python
Setuptoolsインストール
[root@localhost Python-2.6]# cd /usr/local/src
[root@localhost src]# wget http://peak.telecommunity.com/dist/ez_setup.py
[root@localhost src]# /usr/local/python2.6/bin/python ez_setup.py
----------------------------------------------------------------------
Downloading http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg
Processing setuptools-0.6c11-py2.6.egg
Copying setuptools-0.6c11-py2.6.egg to /usr/local/python2.6/lib/python2.6/site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install script to /usr/local/python2.6/bin
Installing easy_install-2.6 script to /usr/local/python2.6/bin
Installed /usr/local/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11
----------------------------------------------------------------------
[root@localhost src]# rm ez_setup.py
// Installed setuptools version can be checked with the following commands
[root@chealsea src]# /usr/local/python2.6/bin/python
Python 2.6 (r26:66714, Oct 10 2010, 23:56:21)
>>> import setuptools
>>> setuptools.__version__
'0.6c11'
Genshiインストール
[root@localhost src]# /usr/local/python2.6/bin/easy_install Genshi
----------------------------------------------------------------------
Searching for Genshi
Reading http://pypi.python.org/simple/Genshi/
Reading http://genshi.edgewall.org/
Reading http://genshi.edgewall.org/wiki/Download
Best match: Genshi 0.6
Downloading http://ftp.edgewall.com/pub/genshi/Genshi-0.6-py2.6.egg
Processing Genshi-0.6-py2.6.egg
Moving Genshi-0.6-py2.6.egg to /usr/local/python2.6/lib/python2.6/site-packages
Adding Genshi 0.6 to easy-install.pth file
Installed /usr/local/python2.6/lib/python2.6/site-packages/Genshi-0.6-py2.6.egg
Processing dependencies for Genshi
Finished processing dependencies for Genshi
----------------------------------------------------------------------
swigインストール
[root@localhost src]# wget http://downloads.sourceforge.net/swig/swig-1.3.31.tar.gz
[root@localhost src]# tar -vxzf swig-1.3.31.tar.gz
[root@localhost src]# cd swig-1.3.31
[root@localhost swig-1.3.31]# ./configure --prefix=/usr/local/swig1.3 --with-python=/usr/local/python2.6/bin/
[root@localhost swig-1.3.31]# make
[root@localhost swig-1.3.31]# make install
[root@localhost swig-1.3.31]# /usr/local/swig1.3/bin/swig -version
Subversionインストール
[root@localhost swig-1.3.31]# cd /usr/local/src/
[root@localhost src]# wget http://subversion.tigris.org/downloads/subversion-1.6.12.tar.gz
[root@localhost src]# wget http://subversion.tigris.org/downloads/subversion-deps-1.6.12.tar.gz
[root@localhost src]# tar -zxvf subversion-1.6.12.tar.gz
[root@localhost src]# tar -zxvf subversion-deps-1.6.12.tar.gz
[root@localhost src]# cd subversion-1.6.12
[root@localhost subversion-1.6.12]# ./configure --prefix=/usr/local/subversion1.6 --with-apr=/usr/local/apache2/ --with-apr-util=/usr/local/apache2/ --with-ssl --with-apxs=/usr/local/apache2/bin/apxs PYTHON=/usr/local/python2.6/bin/python --with-swig=/usr/local/swig1.3/bin/swig
[root@localhost subversion-1.6.12]# make
[root@localhost subversion-1.6.12]# make install
Install Specific Language Bindings
[root@localhost subversion-1.6.12]# make swig-py
----------------------------------------------------------------------
mkdir /usr/local/src/subversion-1.6.12/subversion/bindings/swig/python/libsvn
----------------------------------------------------------------------
[root@localhost subversion-1.6.12]# make check-swig-py
[root@localhost subversion-1.6.12]# make install-swig-py
// リポジトリ作成
[root@localhost subversion-1.6.12]# mkdir -p /usr/local/svn
[root@localhost subversion-1.6.12]# /usr/local/subversion1.6/bin/svnadmin create --fs-type fsfs /usr/local/svn/test
[root@localhost subversion-1.6.12]# chown -R daemon:daemon /usr/local/svn
// リポジトリ認証用アカウント
[root@localhost subversion-1.6.12]# /usr/local/apache2/bin/htpasswd -c /usr/local/svn/.htpasswd weihu
httpd.conf設定
[root@localhost subversion-1.6.12]# vi /usr/local/apache2/conf/httpd.conf
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Include conf/extra/httpd-svn.conf
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// httpd-svn.conf設定
[root@localhost subversion-1.6.12]# vi /usr/local/apache2/conf/extra/httpd-svn.conf
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<Location /svn>
DAV svn
SVNParentPath /usr/local/svn
AuthType Basic
AuthName "svn"
AuthUserFile /usr/local/svn/.htpasswd
Require valid-user
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// http.confファイルの正確性を確認
[root@localhost subversion-1.6.12]# /usr/local/apache2/bin/apachectl -t
// PATHを通す
[root@localhost subversion-1.6.12]# vi ~/.bash_profile
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SVN_HOME=/usr/local/subversion1.6
PYTHON_HOME=/usr/local/python2.6
PATH=$PYTHON_HOME/bin:$SVN_HOME/bin/:$PATH:$HOME/bin
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@localhost local]# source ~/.bash_profile
[root@localhost local]# env
// Pythonバージョン確認
[root@localhost subversion-1.6.12]# python -V
mod_pytonインストール
[root@localhost svn]# cd /usr/local/src/
[root@localhost src]# wget http://ftp.kddilabs.jp/infosystems/apache//httpd/modpython/mod_python-3.3.1.tgz
[root@localhost src]# tar -vxzf mod_python-3.3.1.tgz
[root@localhost src]# cd mod_python-3.3.1
[root@localhost mod_python-3.3.1]# ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python=/usr/local/python2.6/bin/python --prefix=/usr/local/mod_python3.3
[root@localhost mod_python-3.3.1]# make
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// エラー発生(参考 http://issues.apache.org/jira/browse/MODPYTHON-249)
connobject.c: In function ‘_conn_read’:
connobject.c:142: error: request for member ‘next’ in something not a structure or union
apxs:Error: Command failed with rc=65536
.
make[1]: *** [mod_python.so] エラー 1
make[1]: ディレクトリ `/usr/local/src/mod_python-3.3.1/src' から出ます
make: *** [do_dso] エラー 2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[root@localhost mod_python-3.3.1]# vi /usr/local/src/mod_python-3.3.1/src/connobject.c +142
[root@localhost mod_python-3.3.1]# make
[root@localhost mod_python-3.3.1]# make install
----------------------------------------------------------------------
writing byte-compilation script '/tmp/tmpivgyHe.py'
/usr/local/python2.6/bin/python2.6 -OO /tmp/tmpivgyHe.py
removing /tmp/tmpivgyHe.py
running install_egg_info
Writing /usr/local/python2.6/lib/python2.6/site-packages/mod_python-3.3.1-py2.6.egg-info
----------------------------------------------------------------------
// apache設定
[root@localhost mod_python-3.3.1]# vi /usr/local/apache2/conf/httpd.conf
// 下記のコードを追加
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LoadModule python_module modules/mod_python.so
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@localhost mod_python-3.3.1]# chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so
// http.confファイルの正確性を確認
[root@localhost mod_python-3.3.1]# /usr/local/apache2/bin/apachectl -t
tracインストール
[root@localhost mod_python-3.3.1]# /usr/local/python2.6/bin/easy_install http://svn.edgewall.org/repos/trac/tags/trac-0.11
----------------------------------------------------------------------
Downloading http://svn.edgewall.org/repos/trac/tags/trac-0.11
Doing subversion checkout from http://svn.edgewall.org/repos/trac/tags/trac-0.11 to /tmp/easy_install-1dRcRN/trac-0.11
Processing trac-0.11
Running setup.py -q bdist_egg --dist-dir /tmp/easy_install-1dRcRN/trac-0.11/egg-dist-tmp-TgP2FP
Adding Trac 0.11 to easy-install.pth file
Installing trac-admin script to /usr/local/python2.6/bin
Installing tracd script to /usr/local/python2.6/bin
Installed /usr/local/python2.6/lib/python2.6/site-packages/Trac-0.11-py2.6.egg
Processing dependencies for Trac==0.11
Finished processing dependencies for Trac==0.11
----------------------------------------------------------------------
// tracリポジトリの作成
[root@localhost mod_python-3.3.1]# mkdir -p /usr/local/trac
[root@localhost mod_python-3.3.1]# trac-admin /usr/local/trac/test initenv
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Creating and Initializing Project
Failed to create environment. global name 'sqlite' is not defined
Traceback (most recent call last):
File "/usr/local/python2.6/lib/python2.6/site-packages/Trac-0.11-py2.6.egg/trac/admin/console.py", line 543, in do_initenv
options=options)
File "/usr/local/python2.6/lib/python2.6/site-packages/Trac-0.11-py2.6.egg/trac/env.py", line 188, in __init__
self.create(options)
File "/usr/local/python2.6/lib/python2.6/site-packages/Trac-0.11-py2.6.egg/trac/env.py", line 311, in create
DatabaseManager(self).init_db()
File "/usr/local/python2.6/lib/python2.6/site-packages/Trac-0.11-py2.6.egg/trac/db/api.py", line 70, in init_db
connector.init_db(**args)
File "/usr/local/python2.6/lib/python2.6/site-packages/Trac-0.11-py2.6.egg/trac/db/sqlite_backend.py", line 136, in init_db
cnx = sqlite.connect(path, timeout=int(params.get('timeout', 10000)))
NameError: global name 'sqlite' is not defined
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[root@localhost mod_python-3.3.1]# chown -R daemon:daemon /usr/local/trac/test
[root@localhost mod_python-3.3.1]# mkdir -p /usr/local/trac_cache/.egg-cache
[root@localhost mod_python-3.3.1]# chown -R daemon:daemon /usr/local/trac_cache/.egg-cache
// Tracdを起動し、IEで確認
[root@localhost mod_python-3.3.1]# tracd --port 8000 /usr/local/trac/test
website:
http://trac.edgewall.org/
// httpd.conf設定
[root@localhost mod_python-3.3.1]# vi /usr/local/apache2/conf/httpd.conf
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Include conf/extra/httpd-trac.conf
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// httpd-trac.conf設定
[root@localhost subversion-1.6.12]# vi /usr/local/apache2/conf/extra/httpd-trac.conf
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /usr/local/trac
PythonOption TracUriRoot /trac
PythonOption PYTHON_EGG_CACHE /usr/local/trac_cache/.egg-cache
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /usr/local/svn/.htpasswd
Require valid-user
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// http.confファイルの正確性を確認
[root@localhost mod_python-3.3.1]# /usr/local/apache2/bin/apachectl -t
// Httpdを再起動
[root@chealsea mod_python-3.3.1]# /usr/local/apache2/bin/apachectl restart