ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

01_linux:02_www:82_centos_5.8_apache_2.2_php_5.3_suphp_0.7.1

82 CentOS 5.8 + Apache 2.2 + PHP 5.3 + suPHP 0.7.1

suPHP 0.7.1

PHP 5.3 にアップデートすると、suPHPはyumで入らないのでソースからインストール

suPHP 0.7.2 はこちら

必要なパッケージインストール

# yum install apr apr-devel apr-util apr-util-devel httpd-devel php53-devel

suPHPソースから

# wget http://www.suphp.org/download/suphp-0.7.1.tar.gz
# tar -xzf suphp-0.7.1.tar.gz
# cd suphp-0.7.1
# ./configure --with-apr=/usr/bin/apr-1-config
# make
# make install

/usr/local/etc/suphp.conf

[global]
logfile=/var/log/httpd/suphp_log
loglevel=info
webserver_user=apache
docroot=/
env_path=/bin:/usr/bin
umask=0022
min_uid=500
min_gid=100

; 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

[handlers]
;Handler for php-scripts
;x-httpd-php=php:/usr/bin/php
x-httpd-php="php:/usr/bin/php-cgi"

;Handler for CGI-scripts
x-suphp-cgi=execute:!self

/etc/httpd/conf.d/suphp.conf

# This is the Apache server configuration file providing suPHP support.
# It contains the configuration directives to instruct the server how to
# serve php pages while switching to the user context before rendering.

LoadModule suphp_module modules/mod_suphp.so

# This option tells mod_suphp if a PHP-script requested on this server (or
# VirtualHost) should be run with the PHP-interpreter or returned to the
# browser "as it is".
suPHP_Engine on

# Disable php when suphp is used, to avoid having both.
#<IfModule mod_php5.c>
#php_admin_flag engine off
#</IfModule>
#<IfModule mod_php4.c>
#php_admin_flag engine off
#</IfModule>

# To use suPHP to parse PHP-Files
AddHandler x-httpd-php .php
AddHandler x-httpd-php .php .php4 .php3 .phtml

# This option tells mod_suphp which path to pass on to the PHP-interpreter
# (by setting the PHPRC environment variable).
# Do *NOT* refer to a file but to the directory the file resides in.
#
# E.g.: If you want to use "/path/to/server/config/php.ini", use "suPHP_Config
# /path/to/server/config".
#
# If you don't use this option, PHP will use its compiled in default path.
suPHP_ConfigPath /etc

# If you compiled suphp with setid-mode "force" or "paranoid", you can
# specify the user- and groupname to run PHP-scripts with.
# Example: suPHP_UserGroup foouser bargroup
# suPHP_UserGroup apache apache

# This option tells mod_suphp to handle requests with the type <mime-type>.
# Please note this only works, if an action for the handler is specified
# in the suPHP configuration file.
 suPHP_AddHandler x-httpd-php

# This option tells mod_suphp to NOT handle requests with the type <mime-type>.
# suPHP_RemoveHandler <mime-type>

Apache側修正

/etc/httpd/conf/httpd.conf

<VirtualHost *:80>
    ServerAdmin matsui@ma21.ath.cx
    ServerName dokuwiki-test.fl8.jp
    DocumentRoot /home/www/public_html/dokuwiki-test
    suPHP_UserGroup matsui users
</VirtualHost>

Apache再起動

# /etc/init.d/httpd restart

確認

確認は、phpinfo();を置いてみるて、Server APIが「CGI/FastCGI」なっていればOKです。

Server API 	CGI/FastCGI 
01_linux/02_www/82_centos_5.8_apache_2.2_php_5.3_suphp_0.7.1.txt · 最終更新: 2018/05/11 17:59 by matsui