Bug#594571: SuPHP and PHP5 on Debian Squeeze

2011-02-19 Thread Rimas Kudelis
libapache2-mod-suphp DOES NOT conflict with libapache2-mod-php5, just 
their configs aren't in sync, as stated in previous comments.


In fact, libapache2-mod-php5 is still pretty much required if you have 
any of the php applications installed as debs (e.g. I have phpmyadmin 
and roundcube). The files in these packages are owned by root, so they 
shouldn't be suphp'd.


Here's what worked for me. Everythind runs under suphp for me except 
those php applications installed from packages:


1) remove /etc/apache2/mods-enabled/php5.conf (leave php5.load untouched)
2) put the following into /etc/apache2/mods-enabled/suphp.conf:

*** FROM HERE ***
IfModule mod_suphp.c
FilesMatch \.ph(p3?|tml)$
SetHandler application/x-httpd-suphp
suPHP_AddHandler application/x-httpd-suphp
/FilesMatch

Directory /
suPHP_Engine on
/Directory

# By default, disable suPHP for debian packaged web applications as 
files

# are owned by root and cannot be executed by suPHP because of min_uid.
Directory /usr/share
suPHP_Engine off
IfModule mod_php5.c
FilesMatch \.ph(p3?|tml)$
SetHandler application/x-httpd-php
/FilesMatch
/IfModule
/Directory
Directory /var/lib
suPHP_Engine off
IfModule mod_php5.c
FilesMatch \.ph(p3?|tml)$
SetHandler application/x-httpd-php
/FilesMatch
/IfModule
/Directory

# # Use a specific php config file (a dir which contains a php.ini file)
#   suPHP_ConfigPath /etc/php4/cgi/suphp/
# # Tells mod_suphp NOT to handle requests with the type mime-type.
#   suPHP_RemoveHandler mime-type
/IfModule
*** TO HERE ***

If desired to ship by default, the mod_userdir stanza could probably 
also be adapted, like this (note: I haven't tested it):


# To re-enable php in user directories comment the following lines
# (from IfModule ... to /IfModule.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
IfModule mod_userdir.c
Directory /home/*/public_html
suPHP_Engine off
/Directory
/IfModule


HTH



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#594571: SuPHP and PHP5 on Debian Squeeze

2011-02-13 Thread Shlomi Bazak
Hey there,

This problem is new to Debian and there is nothing wrong with suphp or
apache.
The only thing is that mod-php5 config uses FilesMatch
.phpsethandler/FilesMatch and
mod-suphp uses AddType .php, so one may edit one of those modules .conf
file, to set the declaration as in the other file.
I suggest to edit the php5.conf in /etc/apache2/mods-available/
(if you'll set the suphp with FilesMatch * tag then you'll have to rewrite
the config files of phpmyadmin horde and etc... because they use AddType
declaration)


vim /etc/apache2/mods-available/php5.conf

Comment the  files match declaration.
Add the Add Type declaration.

So the file will look like:
#=
IfModule mod_php5.c
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
# FilesMatch \.ph(p3?|tml)$
#SetHandler application/x-httpd-php
# /FilesMatch
#FilesMatch \.phps$
#SetHandler application/x-httpd-php-source
#/FilesMatch
# To re-enable php in user directories comment the following lines
# (from IfModule ... to /IfModule.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
IfModule mod_userdir.c
Directory /home/*/public_html
php_admin_value engine Off
/Directory
/IfModule
/IfModule
#=


I do suggest that Debian should change the php5.conf back, or change all
packages in question
to use the FilesMatch * declaration.

Hope I helped you and some other guys out there with this problem,
since I've spend some time with this issue : )

___

Regards,
Shlomi Bazak
SBZsoft (c) http://www.sbzsoft.com