21
5月
2
vine4.2+apache2.2.8+php5.2.6+suphp-0.6.3のインストール
個人的メモみたいなものです。
あまり参考にはならないかも・・・・
■apache2.2.8のインストール
> apt-get install expat-devel zlib-devel apr-devel apr-util-devel sqlite3-devel
> http://ring.u-toyama.ac.jp/archives/linux/Vine/VineSeed/SRPMS.main/apache2-2.2.8-1vl5.src.rpm
> rpm -ivh apache2-2.2.8-1vl5.src.rpm
> cd /usr/src/vine/SPECS
--------------------------------
1._dist_releaseを1vl5に書き換える
2.--with-suexec-docrootを/homeに書き換える
> vi apache2-vl.spec
--------------------------------
> rpmbuild -bb --clean apache2-vl.spec
> rpm -ivh apache2-2.2.8-1vl5.i386.rpm
> rpm -ivh apache2-devel-2.2.8-1vl5.i386.rpm
--------------------------------
apacheをworkerで動かす
> update-alternatives --config apache2
--------------------------------
■php5.2.6のインストール
> apt-get install libxml2-devel MySQL-client
> wget http://ring.u-toyama.ac.jp/archives/linux/Vine/VineSeed/SRPMS.plus/php5-5.2.6-2vl5.src.rpm
> rpm -ivh php5-5.2.6-2vl5.src.rpm
> cd /usr/src/vine/SPEC
--------------------------------
1.--enable-maintainer-ztsを追加
2.--with-tsrm-pthreadsを追加
> vi php5.spec
--------------------------------
--------------------------------
1.なんかいっぱい必要なパッケージを要求されるので全部aptでいれる
2.aptで入れられないモジュールをwgetでとってきて入れる
> wget http://ring.u-toyama.ac.jp/archives/linux/Vine/VineSeed/i386/RPMS.main/libstdc++34-4.1.2-0vl17.i386.rpm
> wget http://ring.u-toyama.ac.jp/archives/linux/Vine/VineSeed/i386/RPMS.main/libstdc++34-devel-4.1.2-0vl17.i386.rpm
> rpm -ivh libstdc++34-4.1.2-0vl17.i386.rpm libstdc++34-devel-4.1.2-0vl17.i386.rpm
--------------------------------
> rpmbuild -bb --clean php5.spec
> rpm -ivh php5-5.2.6-2vl4.i386.rpm php5-apache2-5.2.6-2vl4.i386.rpm php5-dba-5.2.6-2vl4.i386.rpm php5-devel-5.2.6-2vl4.i386.rpm php5-mysql-5.2.6-2vl4.i386.rpm php5-pear-5.2.6-2vl4.i386.rpm php5-pdo-5.2.6-2vl4.i386.rpm php5-xmlrpc-5.2.6-2vl4.i386.rpm
> vi /etc/php5/php.ini
--------------------------------
mbstring.language = Japanese
mbstring.internal_encoding = auto
;mbstring.http_input = auto
;mbstring.http_output = auto
;mbstring.encoding_translation = On
mbstring.detect_order = auto
;include_path = ".:/usr/local/lib/php"
mbstring.encoding_translation = On
iconv.input_encoding = auto
iconv.internal_encoding = EUC-JP
iconv.output_encoding = EUC-JP
extension_dir = /usr/lib/php5
--------------------------------
■suphp-0.6.3のインストール
--------------------------------
httpdがない!と起こられるので・・・
> cd /usr/sbin
> ln -s apache2 httpd
--------------------------------
> cd /usr/local/src
> http://www.suphp.org/download/suphp-0.6.3.tar.gz
> tar zxvf suphp-0.6.3.tar.gz
> ./configure ¥
--prefix=/usr ¥
--with-apxs=/usr/sbin/apxs ¥
--with-min-uid=500 ¥
--with-min-gid=500 ¥
--with-apache-user=apache ¥
--with-logfile=/var/log/apache2/suphp.log ¥
--with-php=/usr/bin/php5-cgi ¥
--sysconfdir=/etc ¥
--with-apr=/usr/bin/apr-1-config ¥
--with-setid-mode=owner
--------------------------------
Makefileの内のapacheとなっている部分をすべてapache2に書き換える
> vi src/apache2/Makefile
--------------------------------
--------------------------------
httpd.confからLoadModuleを使えるようにする
> vi src/apache2/mod_suphp.c
---
-AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"),
+AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"),
---
--------------------------------
> make
> make install
--------------------------------
mod_suphp.soをmodulesに移動
> cd /usr/lib/apache2
> mv mod_suphp.so modules/
--------------------------------
> vi /etc/suphp.conf
(日本語訳ドキュメント:http://d.hatena.ne.jp/MasaGon/20080327/1206631272)
--------------------------------
[global]
;Path to logfile
logfile=/var/log/apache2/suphp.log
;Loglevel
loglevel=info
;User Apache is running as
webserver_user=apache
;Path all scripts have to be in
docroot=/home/
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false
;Send minor error messages to browser
errors_to_browser=true
;PATH environment variable
env_path=/usr/bin:/usr/local/bin:/usr/sbin:/usr/local/sbin
;Umask to set, specify in octal notation
umask=0022
; Minimum UID
min_uid=500
; Minimum GID
min_gid=500
[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php5-cgi
;Handler for CGI-scripts
x-suphp-cgi=execute:!self
--------------------------------
> vi /etc/apache2/conf/httpd.conf
--------------------------------
#LoadModule php5_module modules/libphp5.so
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps
LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine on
AddHandler x-httpd-php .php
suPHP_AddHandler x-httpd-php
--------------------------------
これでやっと個人的理想環境(apacheは最新版でmpm-worker、phpも最新版で且つsuPHPでユーザー権限で動作)になったのです。
Enjoyed reading this post?
Subscribe to the RSS feed and have all new posts delivered straight to you.
Subscribe to the RSS feed and have all new posts delivered straight to you.
2 Comments:
Post your comment
[…] apache2.2.8の時と同じ手順でrpmを作成してアップグレードして終わり。 […]
[…] ということでvine4.2+apache2.2.8+php5.2.6+suphp-0.6.3のインストールと同じ手順でアップグレード。 […]