操作系统: Ubuntu 10.04 etc/suphp/suphp.conf:
[global]
;Path to logfile
logfile=/var/log/suphp/suphp.log
;Loglevel
loglevel=info
;User Apache is running as
webserver_user=www-data
;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=true
;Send minor error messages to browser
errors_to_browser=false
;PATH environment variable
env_path=/bin:/usr/bin
;Umask to set, specify in octal notation
umask=0077
; Minimum UID
min_uid=100
; Minimum GID
min_gid=100
[handlers]
;Handler for php-scripts
application/x-httpd-suphp="php:/usr/bin/php-cgi"
;Handler for CGI-scripts
x-suphp-cgi="execute:!self"某些站点中的vhost已启用:
NameVirtualHost *:8080
<VirtualHost *:8080>
ServerAdmin ...
ServerName ...
ServerAlias ...
AddType application/x-httpd-php .php
AddHandler application/x-httpd-php .php
suPHP_Engine on
suPHP_UserGroup user user
suPHP_ConfigPath "/home/user/etc"
suPHP_PHPPath /usr/bin
DocumentRoot /home/user/web/site.com/
ErrorLog /var/log/apache2/site.com-error_log
CustomLog /var/log/apache2/site.com-access_log common
<Directory /home/user/web/site.com/>
Order Deny,Allow
Allow from all
Options +Indexes
</Directory>
</VirtualHost>但是当我做nano /home/user/web/id.php和粘贴时
<?php
system('id');
?>在其中,我得到的结果是:
uid=33(www-data) gid=33(www-data) groups=33(www-data) 我不知道该怎么做,所以我希望能帮上忙
泰。
发布于 2010-12-13 12:08:40
唯一让我大吃一惊的是,文档说suPHP_UserGroup user user语句只在<Directory> ... </Directory>中有效。
编辑-我设置了这个并且它是工作的-这就是我所做的
我创建了包含/etc/apache2/mods-available/suphp.conf的
<IfModule mod_suphp.c>
AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml
suPHP_AddHandler application/x-httpd-suphp
</IfModule>和含有/etc/apache2/mods-available/suphp.load的
LoadModule suphp_module /usr/lib/apache2/modules/mod_suphp.so我跑了
sudo a2enmod suphp
sudo a2dismod php5启用suphp和禁用php
我的vhost在站点中启用
<VirtualHost *:80>
ServerAdmin webmaster@localhost
suPHP_Engine on
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
suPHP_UserGroup user user
</Directory>
.
. other stuff
.
</VirtualHost>/var/www归user:user所有,我的/etc/suphp/suphp.conf功能与您的. OS是Ubuntu10.04相同
https://serverfault.com/questions/211791
复制相似问题