PDA

View Full Version : SuPHP and ISPconfig


planet_fox
12th November 2006, 12:41
I have howto up suphp run and i have some questions

questions 1

I have apache2-mpm install already. must I install for suphp apache2-worker ?
The problem I have lots of websites on this server.

questions 2

what must i wride in vhostsconfig in /etc/apache2/Vhosts/chosts_ispconfig,
my root directory for user is under /home/websites/ is it a problem ?

question 3

# Vhost: www.myhost.de:80
######################################
#
#
<VirtualHost 878.155.7.886:80>
<Directory /home/times/www.ed-talk.de/web/>
Options +Includes +FollowSymlinks -Indexes
AllowOverride All
Order allow,deny
Allow from all
<Files ~ '^.ht'>
Deny from all
</Files>
</Directory>
SuexecUserGroup web4_ftp web4
ServerName myhost.de:80
ServerAdmin webmaster@myhost.de
DocumentRoot /home/times/web4/web
ServerAlias myhost.de.de www.myhost.de
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm def$
ScriptAlias /cgi-bin/ /home/times/web4/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /home/times/web4/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode Off
Alias /error/ "/home/times/web4/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /home/times/web4/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/times/web4/user/$1/web/$3
</VirtualHost>

and this tags musst in this vhost on which line ?

suPHP_Engine on
suPHP_UserGroup web4_ftp web4
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php

This is my /etc/suphp.conf

[global]
;Path to logfile
logfile=/var/log/suphp.log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=www-data

;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=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
x-httpd-php=php:/usr/bin/php
x-httpd-php=php:/usr/bin/php4-cgi
x-httpd-php5=php:/usr/bin/php5-cgi

;Handler for CGI-scripts
x-suphp-cgi=execute:!self


Thanks for help

I have set in /home/admispconfig/ispconfig/lib/config.inc.php

$go_info["server"]["apache2_php"] = 'both'; to suphp

till
12th November 2006, 16:06
1) I gueess you will have to install apache2-worker
2) NEVER edit the file Vhost_ispconfig.conf manually.
3) Set $go_info["server"]["apache2_php"] = 'suphp';, you dont have to configure anything else when SuPHP is installed on your system properly.

planet_fox
12th November 2006, 19:01
hm ok i must only install apache2-worker and set

$go_info["server"]["apache2_php"] = 'suphp';

suphp howto i have try from howtoforge.

Whats then in the enable order
with the apache2-worker can`t run php as mod is ? is this right ?

ok in vhost do anything and remove apache2-mpm and install apache2-worker.

planet_fox
13th November 2006, 01:23
when I do install apache2-mpm-worker . say apache2 this
Starting web server: Apache2Syntax error on line 49 of /etc/apache2/vhosts/Vhosts_ispconfig.conf:
Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration
invoke-rc.d: initscript apache2, action "start" failed.

planet_fox
13th November 2006, 02:12
When I do all webs php support delete ser start .

till
13th November 2006, 11:09
when I do install apache2-mpm-worker . say apache2 this

Please set this value in the config.inc.php:

$go_info["server"]["apache2_php"] = 'suphp';

and then change a website in ISPConfig, so ISPConfig will start to rewrite your Vhost_ispconfig.conf

planet_fox
13th November 2006, 11:54
$go_info["server"]["apache2_php"] = 'suphp';
I have already.

When i do change 1 websites ispconfig change vhost config and do all websites remove phpflags in the vhosts and then i can start apache2 and the problem with phpflags is over. Thats right ?

falko
13th November 2006, 16:56
When i do change 1 websites ispconfig change vhost config and do all websites remove phpflags in the vhosts and then i can start apache2 and the problem with phpflags is over. Thats right ?
Yes, that's right.

planet_fox
14th November 2006, 01:58
I have do what you say and I have see ispconfig makes the configs for
Vhost with suphp self and when ido after restart apache says me that

suPHP_AddHandler not allowed here in /etc/apüache2/vhosts/....

till
14th November 2006, 10:40
Thats a known bug in SuPHP. Please have a look here how to patch it:

http://www.howtoforge.com/apache2_suphp_php4_php5_p2

planet_fox
14th November 2006, 15:25
./configure --prefix=/usr --sysconfdir=/etc --with-apache-user=www-data --with-setid-mode=paranoid --with-apxs=/usr/bin/apxs2
make
make install

Questions must I change this for apache2

--with-apache-user=www-data
to
--with-apache2-user=www-data

falko
14th November 2006, 15:38
I don't think so, but you can run
./configure --help
to find out about it.

planet_fox
14th November 2006, 16:36
no I menan musat I change this for Apache2 or is the same for apache and apache2. I use apache2

--with-apache-user=www-data
to
--with-apache2-user=www-data

edony44
14th November 2006, 19:58
i've installed suphp
all work if i put the vhost directive in ispconfig
suphp_engine on ...

but not if i don't put them ...
Is it ok ?
I was thinking that ispconfig auto-add these line !

planet_fox
15th November 2006, 02:21
ok I have this Problem all sites with php error 500

and this is in the logfiles from /var/logs/suphp

[Wed Nov 15 01:00:20 2006] [info] Executing "/home/times/web9/web/coppermine/thumbnails.php" as UID 10003, GID 10009
[Wed Nov 15 01:00:28 2006] [info] Executing "/home/times/web9/web/index.php" as UID 10003, GID 10009
[Wed Nov 15 01:01:40 2006] [warn] Directory "/home/times/web40/web" is writeable by others
[Wed Nov 15 01:01:41 2006] [warn] Directory "/home/times/web40/web" is writeable by others
[Wed Nov 15 01:01:42 2006] [warn] Directory "/home/times/web40/web" is writeable by others
[Wed Nov 15 01:01:52 2006] [warn] Directory "/home/times/web40/web" is writeable by others
[Wed Nov 15 01:02:22 2006] [warn] File "/home/times/web40/web/news/index.php" is writeable by others
[Wed Nov 15 01:02:32 2006] [warn] Directory "/home/times/web40/web/forum" is writeable by others
[Wed Nov 15 01:02:42 2006] [info] Executing "/home/times/web9/web/coppermine/thumbnails.php" as UID 10003, GID 10009
[Wed Nov 15 01:02:42 2006] [info] Executing "/home/times/web67/web/index.php" as UID 10100, GID 10067


and in /var/apache2/error.log

[Wed Nov 15 00:56:53 2006] [error] [client 62.245.160.105] File does not exist: /var/www/sharedip/apache2-default
[Wed Nov 15 00:58:30 2006] [notice] caught SIGTERM, shutting down
[Wed Nov 15 00:58:31 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Wed Nov 15 00:58:32 2006] [notice] Apache configured -- resuming normal operations
[Wed Nov 15 01:12:24 2006] [notice] caught SIGTERM, shutting down
[Wed Nov 15 01:12:25 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Wed Nov 15 01:12:26 2006] [notice] Apache configured -- resuming normal operations
[Wed Nov 15 01:13:15 2006] [notice] caught SIGTERM, shutting down
[Wed Nov 15 01:13:16 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Wed Nov 15 01:13:17 2006] [notice] Apache configured -- resuming normal operations


php4 -v

php4 -v
PHP 4.4.4-0.dotdeb.1 (cli) (built: Aug 21 2006 16:07:30)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


php4-cgi -v

PHP 4.4.4-0.dotdeb.1 (cgi-fcgi) (built: Aug 21 2006 16:05:04)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


suphp -v

suPHP version 0.6.1
(c) 2002-2005 Sebastian Marsching

suPHP has to be called by mod_suphp to work.

a Vhost

######################################
# Vhost: www.myhost.de:80
######################################
#
#
<VirtualHost 88.191.7.886:80>
SuexecUserGroup web1_ftp web1
ServerName www.myhost.de:80
ServerAdmin webmaster@myhost.de
DocumentRoot /home/times/web1/web
ServerAlias myhost.de
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ScriptAlias /cgi-bin/ /home/times/web1/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /home/times/web1/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
suPHP_Engine on
suPHP_UserGroup web1_ftp web1
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php
Alias /error/ "/home/times/web1/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /home/times/web1/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/times/web1/user/$1/web/$3
</VirtualHost>

till
15th November 2006, 10:05
i've installed suphp
all work if i put the vhost directive in ispconfig
suphp_engine on ...

but not if i don't put them ...
Is it ok ?
I was thinking that ispconfig auto-add these line !

ISPConfig adds these lines automatically if you enabled it in the config.inc.php file. You will have to modify one website afterwards so the Vhost_ispconfig.conf file is rewritten.

till
15th November 2006, 10:07
PlanetFox:

Please post the output of:

ls -la /home/times/web67/web/index.php

planet_fox
15th November 2006, 10:58
ISPConfig adds these lines automatically if you enabled it in the config.inc.php file. You will have to modify one website afterwards so the Vhost_ispconfig.conf file is rewritten.

Yes I have understand, suphp is enabled in isp config.inc.php


ls -la /home/times/web67/web/index.php say me that

-rw-rw-r-- 1 web67_ftp web67 4745 Nov 9 19:03 /home/times/web67/web/index.php

edony44
15th November 2006, 13:36
Ok i've solve my problem !!
i have to change group write permission in suphp or change mask !
Thanks

falko
15th November 2006, 14:24
no I menan musat I change this for Apache2 or is the same for apache and apache2. I use apache2

--with-apache-user=www-data
to
--with-apache2-user=www-data
As I said before, you can run
./configure --help to find out about all configuration options, also if it's --with-apache-user or --with-apache2-user.

planet_fox
17th November 2006, 23:55
ok, I have this understand this with apache and apache2 .

Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]


Must I somthing do for debian with ispconfig do with this parameters?

--bindir=DIR
--sbindir=DIR
--libexecdir=DIR
--datadir=DIR

falko
18th November 2006, 16:20
Must I somthing do for debian with ispconfig do with this parameters?

--bindir=DIR
--sbindir=DIR
--libexecdir=DIR
--datadir=DIR
No, that's not necessary.

planet_fox
19th November 2006, 00:20
ok i must nothing do . Apache do running and php do not work

falko
19th November 2006, 19:00
Any errors in your logs?

planet_fox
13th December 2006, 04:39
yes here can you see

[Wed Dec 13 02:32:45 2006] [error] [client 82.135.4.3] Invalid method in request \x16\x03\x01
[Wed Dec 13 02:33:22 2006] [error] [client 66.249.65.47] File does not exist: /var/www/index2.php
[Wed Dec 13 02:34:55 2006] [error] [client 66.249.65.47] File does not exist: /var/www/coppermine
[Wed Dec 13 02:34:55 2006] [error] [client 66.249.65.47] File does not exist: /var/www/coppermine
[Wed Dec 13 02:35:00 2006] [error] [client 84.145.0.197] File does not exist: /var/www/favicon.ico
[Wed Dec 13 02:36:01 2006] [notice] caught SIGTERM, shutting down
[Wed Dec 13 02:36:02 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Wed Dec 13 02:36:02 2006] [notice] Apache configured -- resuming normal operations
[Wed Dec 13 02:36:27 2006] [error] [client 82.135.4.3] Invalid method in request \x16\x03\x01
[Wed Dec 13 02:36:47 2006] [error] [client 82.135.4.3] Invalid method in request \x16\x03\x01
[Wed Dec 13 02:39:14 2006] [notice] caught SIGTERM, shutting down
[Wed Dec 13 02:41:28 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Wed Dec 13 02:41:28 2006] [notice] Apache configured -- resuming normal operations
[Wed Dec 13 02:41:47 2006] [error] [client 82.135.4.3] Invalid method in request \x16\x03\x01
[Wed Dec 13 02:54:40 2006] [notice] caught SIGTERM, shutting down
[Wed Dec 13 02:54:42 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Wed Dec 13 02:54:42 2006] [notice] Apache configured -- resuming normal operations
[Wed Dec 13 03:05:34 2006] [notice] Graceful restart requested, doing restart
[Wed Dec 13 03:05:34 2006] [notice] Apache configured -- resuming normal operations
[Wed Dec 13 03:05:34 2006] [warn] long lost child came home! (pid 31914)
[Wed Dec 13 03:05:46 2006] [notice] caught SIGTERM, shutting down
[Wed Dec 13 03:05:47 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec2)
[Wed Dec 13 03:05:48 2006] [notice] Apache configured -- resuming normal operations


[Wed Dec 13 03:12:33 2006] [warn] File "/home/times/web40/web/info.php" is writeable by group
[Wed Dec 13 03:12:36 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:12:42 2006] [warn] File "/home/www/web9/web/index.php" is writeable by group
[Wed Dec 13 03:12:48 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:12:50 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:13:06 2006] [warn] File "/home/www/web9/web/coppermine/displayimage.php" is writeable by group
[Wed Dec 13 03:14:57 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:14:59 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:15:00 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:15:01 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:15:01 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:15:08 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:15:33 2006] [warn] File "/home/www/web9/web/coppermine/displayimage.php" is writeable by group
[Wed Dec 13 03:15:46 2006] [warn] File "/home/www/web21/web/petition.php" is writeable by group
[Wed Dec 13 03:16:00 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:16:02 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:16:03 2006] [warn] File "/home/www/web40/web/info.php" is writeable by group
[Wed Dec 13 03:16:20 2006] [warn] File "/home/www/web40/web/info.php4" is writeable by group
[Wed Dec 13 03:17:45 2006] [warn] File "/home/www/web9/web/index.php" is writeable by group
[Wed Dec 13 03:18:04 2006] [warn] File "/home/www/web9/web/coppermine/thumbnails.php" is writeable by group
[Wed Dec 13 03:21:04 2006] [warn] File "/home/times/web11/web/index.php" is writeable by group

till
13th December 2006, 11:34
Do get around the group writable warnings, please recompile suPHP as described here and disable the group writable check.

http://www.howtoforge.com/apache2_suphp_php4_php5

planet_fox
13th December 2006, 18:10
ok sorry for this idot question "how can I disable the group writable"
on the compile command ?

planet_fox
14th December 2006, 12:59
This is my suphp.conf

[global]
;Path to logfile
logfile=/var/log/suphp.log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=www-data

;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=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
x-httpd-php=php:/usr/bin/php

;Handler for CGI-scripts
x-suphp-cgi=execute:!self


Must here change on this line ?

; 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

falko
14th December 2006, 19:29
You can either chmod your group writeable files, or you set
allow_file_group_writeable=true
in your suphp.conf.

planet_fox
15th December 2006, 03:57
Thanks thats is the error. I have solve the Problem. Just beginn new Problem
I must for some webs set a ph.ini for globals on ..... . How I can do with ISP_ config . I have say it gives for suphp this suPHP_ConfigPath . How can I use with ISp Config.

Thanks and good night

till
15th December 2006, 10:11
When you add the config path directive to the apache directives field of the website, it will be parsed in the vhost configuration file.

planet_fox
15th December 2006, 11:58
Ok, I musst same doing than yaesterday with php_admin_flags. I must in
in Apache directive in Isp Config this set

suPHP_Config /path/to/server/confi <-- is from suphp website

When I Copy php.ini in /home/www/web1/phpini/php.ini

must I set

suPHP_Config /home/www/web1/phpini/php.ini

is this korect ? and whats permission musst I set for php.ini ?

Thanks

till
15th December 2006, 19:02
This looks fine. Chown the php.ini to the web admin user and it must be readable for this user.

planet_fox
15th December 2006, 21:09
ok I do later update isp_config and do testing. I do have lots of learn here about linux. on first time I have hate this forum when I have type english words in key and on this time I have fun. SO we close the thread 4 sites to much when a other search for a problem with install suphp :) .

Best Regards