###前提・実現したいこと
Apache + PHP の環境で、特定のVirtualHost で suEXEC で PHPを動かしたい。
最終的には、複数のサイト(WordPress など)が設定してある状態で、
他のユーザに(一部の)WordPressサイトの管理を任せるようにしたい。
###発生している問題・エラーメッセージ
以下のサイトを参考に、suEXEC の設定をしているが、設定したユーザ権限で
実行されていない気がしています。
■ 参考サイト
- リストapache のsuEXEC で phpを動かしてみる
http://server-setting.info/centos/apache_suexec_php.html
- PHP-CGI + suEXEC 環境の構築手順 (CentOS 6.x)2/2
http://safe-linux.homeip.net/web/WordPress/wordpress-08.html
</opt/home/user1/public_html/info.php>
<?php echo '実行中のユーザーは '.exec('whoami'); phpinfo(); ?>
上記ファイルを設置し、http://server1.example.com/info.php
にアクセスした場合、
「Server API」の値が "Apache 2.0 Handler"になっている。
Server API Apache 2.0 Handler
###該当のソースコード
< suexec -V
の実行結果>
# /usr/sbin/suexec -V -D AP_DOC_ROOT="/var/www" -D AP_GID_MIN=500 -D AP_HTTPD_USER="apache" -D AP_LOG_SYSLOG -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D AP_UID_MIN=500 -D AP_USERDIR_SUFFIX="public_html"
■ suEXEC で実行したいサイトの設定
<httpd-server1.conf>
# ScriptAlias /php5-user1-comm "/var/www/users/user1/php-cgi" <VirtualHost *:80> ServerAdmin webmaster@example.com ServerName server1.example.com DirectoryIndex index.php index.html index.htm DocumentRoot /opt/home/user1/public_html ## #### SuexecUserGroup user1 users AddHandler php5-cgi .php .phps Action php5-cgi /php5-user1-comm ## #### <Directory "/opt/home/user1/public_html"> Options FollowSymLinks MultiViews ExecCGI AllowOverride All Require all granted </Directory> LogLevel warn CustomLog /var/log/httpd/access.server1.example.com.log combined ErrorLog /var/log/httpd/error.server1.example.com.jp.log </VirtualHost>
■ 既存サイトの設定
<httpd-server99.conf>
<VirtualHost *:80> ServerAdmin webmaster@example.com ServerName server99.example.jp DirectoryIndex index.php index.html index.htm DocumentRoot /opt/www/server99.example.jp LogLevel warn <Directory /opt/www/server99.example.jp> Options FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> CustomLog /var/log/httpd/access.server99.example.jp.log combined ErrorLog /var/log/httpd/error.server99.example.jp.log </VirtualHost>
###試したこと
「 .htaccess 」に書いてみたり。。。
# cat /opt/home/user1/public_html/.htacess # AddHandler php5-cgi .php Action php5-cgi /php5-user1-comm
###補足情報(言語/FW/ツール等のバージョンなど)
■ 環境
- Amazon Linux
- Apache/2.4.25
- PHP 5.6.29
他に足りない設定情報があれば、コメントなどにお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/01 16:18