ナビゲーション
FrontPage
FreeBSD
Linux
Citrix XenServer
VMware ESXi
Unixコマンド
MySQL
PostgreSQL
Windows
CMS/CRM
クラウド
用語
PHPスクリプト
Bashシェルスクリプト
Rubyスクリプト
開発日記
検索
ツールボックス
新しいページの作成
バックアップの表示
外部のリンク元
最近更新したページ
全ページ
ヘルプ
凍結
アップロード
ページ名の変更
最新の40件
2016-08-17
Linux/NagiosQL
Linux/CentOSチューニング
2016-02-23
Linux/ソフトウェアRAID復旧手順
2016-02-18
FreeBSD/DHCP
FreeBSD/squid
2016-02-15
Unixコマンド/file
2016-02-05
FreeBSD/DynaBook
FreeBSD/Linux compatibility
2016-01-21
PHPスクリプト/PEAR DBインストールできない
PHPスクリプト/PEAR DB
2016-01-20
PHP/フレームワーク/Zend Framework
PHP/フレームワーク
FreeBSD/Postfix+amavisd+clamav
2016-01-15
FreeBSD/sl
2015-12-04
Unixコマンド/dig
Unixコマンド/nslookup
Unixコマンド/traceroute
Linux/rsync
FreeBSD/rsync
Unixコマンド/vipw
2015-11-25
Linux/Postfix+MySQL+Postfix AdminによるバーチャルSMTPサーバの構築
Linux/Postfix + postgrey
2015-11-24
Linux/Postfix + amavisd + clamav
2015-05-25
Unixコマンド/ifconfig
2015-05-23
Unixコマンド/netstat
Unixコマンド/route
Unixコマンド/lsof
Unixコマンド/disown
Unixコマンド/time
Unixコマンド/crontab
2015-05-22
Unixコマンド/nohup
Unixコマンド/fgとbg
Unixコマンド/nice
Unixコマンド/kill
Unixコマンド/jobs
Unixコマンド/restor
Unixコマンド/dump
Unixコマンド/uncompress
Unixコマンド/compress
Unixコマンド/zcat
total:
5173
today:
1
yesterday:
1
now:
1
本文
ノート
?
編集
差分
一覧
FreeBSD/suPHP の編集
*suPHP [#u1dc2155] [[dokuwiki.fl8.jp転載済み>http://dokuwiki.fl8.jp/doku.php/02_freebsd/02_www/suphp]] #contents **環境 [#p59e3df5] FreeBSD 6.1-RELEASE-p15 Apache/2.2.4 PHP 5.2.1 suPHP 0.6.2 **PHPをCGIモードで動かすよう再コンパイル・インストール [#z90b6ff6] # tar zxvf php-5.2.1.tar.gz # cd php-5.2.1 # ./configure \ --with-mysql=/usr/local \ --with-pgsql=/usr/local/pgsql \ --enable-cgi \ --disable-cli \ --enable-pear \ --with-snmp \ --enable-sockets \ --enable-force-cgi-redirect \ --with-tsrm-pth \ --with-gd \ --with-zlib \ --with-jpeg-dir=/usr/local \ --with-png-dir=/usr/local \ --with-freetype-dir=/usr/local \ --enable-mbstring \ --enable-mbstr-enc-trans \ --enable-trans-sid \ --enable-versioning \ --enable-gd-native-ttf \ --enable-gd-jis-conv #make ;make install ***php.iniの編集 [#obf5f0cd] cgi.force_redirect = 0 &color(red){※PHPをCGIモードで動作させる場合、これをセットしないと「Security Alert! The PHP CGI cannot be accessed directly.」が出てしまう。 }; **suPHPインストール [#n7762069] &color(Red){※SuPHPの動作には[[suidperl>FreeBSD/suidperl]]が必要です。}; ***ソースダウンロードここで最新版をダウンロードしてくる [#xa5d5030] [[suPHP Homepage>http://www.suphp.org/Home.html]] ***tarボールの展開 [#p5ee83a9] $ tar zxvf suphp-0.6.2.tar.gz $ cd suphp-0.6.2 ***コンフィグ [#e4974c7a] $ ./configure --with-min-uid=100 --with-min-gid=100 \ --with-apache-user=www --with-php=/usr/local/bin/php \ --with-logfile=/var/log/apache/suphp.log --with-apxs=/usr/local/sbin/apxs \ --sysconfdir=/usr/local/etc --disable-checkpath \ --with-apr=/usr/local/bin/apr-1-config --with-setid-mode=owner ***suPHP_AddHandlerを使えるようにmod_suphp.cを修正 [#t650b7cd] 下記のように修正すると、httpd.confでsuPHP_AddHandlerが使用可能になる。 $ vi ./src/apache2/mod_suphp.c 324 AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_C ONF, "Tells mod_suphp to handle these MIME-types"), ↓↓ 324 AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_C ONF, "Tells mod_suphp to handle these MIME-types"), ***make,make instlal [#u7a7ca06] $ su # make ;make install ***設定ファイルの用意 [#ae61e68a] # cat /usr/local/etc/suphp.conf [global] ;Path to logfile logfile=/var/log/apache/suphp.log ;Loglevel loglevel=info ;User Apache is running as webserver_user=www ;Path all scripts have to be in docroot=/ ;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=/bin:/usr/bin:/usr/local/bin:/usr/local/sbin ;Umask to set, specify in octal notation umask=0022 ; Minimum UID min_uid=100 ; Minimum GID min_gid=100 [handlers] ;Handler for php-scripts x-httpd-php=php:/usr/local/bin/php ;Handler for CGI-scripts x-suphp-cgi=execute:!self **httpd.confの変更 [#f17afd1b] httpd.confに下記を追加する。 LoadModule suphp_module libexec/apache22/mod_suphp.so suPHP_Engine on AddHandler x-httpd-php .php suPHP_AddHandler x-httpd-php **Apache再起動 [#a74e5c7f] # /usr/local/etc/rc.d/apache22.sh restart **確認 [#j6ac7974] ログが流れているのを確認 # tail -f /var/log/apache/suphp.log *PHPをcgiで動かす場合 [#yd8d7c95] -php.iniを作業ディレクトリに置く事で、そのディレクトリのphpに対して設定を反映させる事ができます。 **例 [#wd5fe9f5] /home/hogehoge/public_html/test.phpを自分で設定したphp.iniを使いたい。 /home/hogehoge/public_html/php.iniを作成し、自分用の設定を書き込む。 -.htaccessでphp_flag/php_valueは使えない **suPHPの環境変数 [#m4dbf60c] &color(Red){※suphpの場合は、環境変数を設定する場合もヴァーチャルホスト毎に行う。}; [[参考>開発日記/2010-04-26]]
タイムスタンプを変更しない
*suPHP [#u1dc2155] [[dokuwiki.fl8.jp転載済み>http://dokuwiki.fl8.jp/doku.php/02_freebsd/02_www/suphp]] #contents **環境 [#p59e3df5] FreeBSD 6.1-RELEASE-p15 Apache/2.2.4 PHP 5.2.1 suPHP 0.6.2 **PHPをCGIモードで動かすよう再コンパイル・インストール [#z90b6ff6] # tar zxvf php-5.2.1.tar.gz # cd php-5.2.1 # ./configure \ --with-mysql=/usr/local \ --with-pgsql=/usr/local/pgsql \ --enable-cgi \ --disable-cli \ --enable-pear \ --with-snmp \ --enable-sockets \ --enable-force-cgi-redirect \ --with-tsrm-pth \ --with-gd \ --with-zlib \ --with-jpeg-dir=/usr/local \ --with-png-dir=/usr/local \ --with-freetype-dir=/usr/local \ --enable-mbstring \ --enable-mbstr-enc-trans \ --enable-trans-sid \ --enable-versioning \ --enable-gd-native-ttf \ --enable-gd-jis-conv #make ;make install ***php.iniの編集 [#obf5f0cd] cgi.force_redirect = 0 &color(red){※PHPをCGIモードで動作させる場合、これをセットしないと「Security Alert! The PHP CGI cannot be accessed directly.」が出てしまう。 }; **suPHPインストール [#n7762069] &color(Red){※SuPHPの動作には[[suidperl>FreeBSD/suidperl]]が必要です。}; ***ソースダウンロードここで最新版をダウンロードしてくる [#xa5d5030] [[suPHP Homepage>http://www.suphp.org/Home.html]] ***tarボールの展開 [#p5ee83a9] $ tar zxvf suphp-0.6.2.tar.gz $ cd suphp-0.6.2 ***コンフィグ [#e4974c7a] $ ./configure --with-min-uid=100 --with-min-gid=100 \ --with-apache-user=www --with-php=/usr/local/bin/php \ --with-logfile=/var/log/apache/suphp.log --with-apxs=/usr/local/sbin/apxs \ --sysconfdir=/usr/local/etc --disable-checkpath \ --with-apr=/usr/local/bin/apr-1-config --with-setid-mode=owner ***suPHP_AddHandlerを使えるようにmod_suphp.cを修正 [#t650b7cd] 下記のように修正すると、httpd.confでsuPHP_AddHandlerが使用可能になる。 $ vi ./src/apache2/mod_suphp.c 324 AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_C ONF, "Tells mod_suphp to handle these MIME-types"), ↓↓ 324 AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_C ONF, "Tells mod_suphp to handle these MIME-types"), ***make,make instlal [#u7a7ca06] $ su # make ;make install ***設定ファイルの用意 [#ae61e68a] # cat /usr/local/etc/suphp.conf [global] ;Path to logfile logfile=/var/log/apache/suphp.log ;Loglevel loglevel=info ;User Apache is running as webserver_user=www ;Path all scripts have to be in docroot=/ ;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=/bin:/usr/bin:/usr/local/bin:/usr/local/sbin ;Umask to set, specify in octal notation umask=0022 ; Minimum UID min_uid=100 ; Minimum GID min_gid=100 [handlers] ;Handler for php-scripts x-httpd-php=php:/usr/local/bin/php ;Handler for CGI-scripts x-suphp-cgi=execute:!self **httpd.confの変更 [#f17afd1b] httpd.confに下記を追加する。 LoadModule suphp_module libexec/apache22/mod_suphp.so suPHP_Engine on AddHandler x-httpd-php .php suPHP_AddHandler x-httpd-php **Apache再起動 [#a74e5c7f] # /usr/local/etc/rc.d/apache22.sh restart **確認 [#j6ac7974] ログが流れているのを確認 # tail -f /var/log/apache/suphp.log *PHPをcgiで動かす場合 [#yd8d7c95] -php.iniを作業ディレクトリに置く事で、そのディレクトリのphpに対して設定を反映させる事ができます。 **例 [#wd5fe9f5] /home/hogehoge/public_html/test.phpを自分で設定したphp.iniを使いたい。 /home/hogehoge/public_html/php.iniを作成し、自分用の設定を書き込む。 -.htaccessでphp_flag/php_valueは使えない **suPHPの環境変数 [#m4dbf60c] &color(Red){※suphpの場合は、環境変数を設定する場合もヴァーチャルホスト毎に行う。}; [[参考>開発日記/2010-04-26]]
テキスト整形のルールを表示する
ログインまたはアカウント作成