少し前にApacheとphpをfastcgiモジュールとしてインストールしました
root@company# apt-get install apache2 apache2-suexec libapache2-mod-fcgid php5-cgi
root@company# dpkg-query -l '*apache2*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============================-==============================-============================================================================
ii apache2 2.2.20-1ubuntu1.2 Apache HTTP Server metapackage
ii apache2-mpm-worker 2.2.20-1ubuntu1.2 Apache HTTP Server - high speed threaded model
ii apache2-suexec 2.2.20-1ubuntu1.2 Standard suexec program for Apache 2 mod_suexec
ii apache2-utils 2.2.20-1ubuntu1.2 utility programs for webservers
ii apache2.2-bin 2.2.20-1ubuntu1.2 Apache HTTP Server common binary files
ii apache2.2-common 2.2.20-1ubuntu1.2 Apache HTTP Server common files
ii libapache2-mod-fcgid 1:2.3.6-1+squeeze1build0.11.10 an alternative module compat with mod_fastcgi
root@company# dpkg-query -l '*php*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=================================-=================================-==================================================================================
un php-pear <none> (no description available)
ii php5-cgi 5.3.6-13ubuntu3.7 server-side, HTML-embedded scripting language (CGI binary)
ii php5-common 5.3.6-13ubuntu3.7 Common files for packages built from the php5 source
un php5-json <none> (no description available)
un php5-mhash <none> (no description available)
un php5-suhosin <none> (no description available)
un phpapi-20090626 <none> (no description available)
root@company# dpkg-query -l '*fcgi*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=================================-=================================-==================================================================================
ii libapache2-mod-fcgid 1:2.3.6-1+squeeze1build0.11.10.1 an alternative module compat with mod_fastcgi
現在、仮想ホストでこのコマンドを使用できないことに気付きました。
php_admin_value open_basedir "/var/www/users/test"
私の場合の典型的な仮想ホストファイル:
<VirtualHost *:80>
ServerName test
ServerAlias test
ServerAdmin webmaster@test.com
DocumentRoot /var/www/users/test/public_html/
<IfModule mod_fcgid.c>
SuexecUserGroup test test
<Directory /var/www/users/test/public_html/>
Options +ExecCGI
Options -Indexes
AllowOverride None
AddHandler fcgid-script .php
FCGIWrapper /var/www/system/test/php-fcgi-starter .php
Order allow,deny
Allow from all
</Directory>
</IfModule>
# ErrorLog /var/log/apache2/error.log
# CustomLog /var/log/apache2/access.log combined
ServerSignature Off
</VirtualHost>
1) ユーザーの家で定義したものを有効open_basedir
にし、ユーザーが変更できるようにする方法についてのアイデア(例: )。編集しようとしても、ユーザーは my 値を変更しないでください。php.ini
/var/www/users/test
php.ini
これは可能ですか?php.ini
または、すべてのユーザーのユーザーアクセスを忘れて、一度だけ変更php.ini
する必要がありますか?
2)次からのすべてのリクエストをリダイレクトするApache2ディレクティブを誰かに教えていただければ幸いです。
http://www.test.com/a/new/post
内部的にこれに:
http://www.test.com/index.php?a/new/post
以下は機能しません-いくつかのパラメーターを指定する必要があります:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
(いいえ、速度の理由から .htaccess ファイルを許可したくありません)
ありがとう!
質問 (2) に対するコメント:<Directory>
セクション内のこのディレクティブが必要なものを実現していることに気付きました。
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ index.php?$1 [NC,L,QSA]
しかし、(表示されていない)でphp画像を提示すると奇妙な動作をします
<?php
phpinfo();
?>
エコーされたファイルでのこの画像のリンクは
<img border="0" src="/info.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42" alt="PHP Logo" />
何か案は?