I am trying use suphp with apache for use a user for each vhost, all vhost is one directory in /var/www/ for example /var/www/user1/ and directory of each vhost only can read write and execute own that is user of that vhost.
I'am using Debian, apache2, I disable mod_php and cgi, enable suphp (I install suphp with apt-get install libapache2_mod_suphp). Configuration file /etc/apache2/conf.d/suphp is this:
[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=/var/www:/var/www/${HOME}/public
;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=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"
And in the vhost are trying use www-data user for if this found add new user and change own of files. File of vhost:
<VirtualHost *:80>
<IfModule mod_suphp.c>
suPHP_Engine on
AddHandler application/x-httpd-suphp .php
suPHP_AddHandler application/x-httpd-suphp
suPHP_UserGroup www-data www-data
</IfModule>
...
And the rest of vhost file is as in vhost without suphp found. When I try /etc/init.d/apache2 restart apache say this error:
Invalid command 'suPHP_UserGroup', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
I try enable module cgi and is same. How fix this error? Thx.