View Full Version : suPHP option
Serge
13th June 2006, 08:45 AM
It would be very nice to have an option to turn on/off the possibility to run php-scripts on behalf of a user, not from the web-server. For example - via suPHP. Not on every domain as it would be incompatible with the existing behaviour but as an option.
It's one of the most required features.
breun
22nd July 2006, 07:09 PM
+1
I'd say just integrate suPHP (like we have suExec for Perl already). People keep asking why they can't remove uploaded pictures, etc. "Well, they're owned by apache, not your domain user." Clients don't really like that answer and setting up cronjobs for the root user to chown -R files seems clunky as well.
atomicturtle
23rd July 2006, 09:40 AM
I completely forgot that I put together some mod_suphp packages in the atomic-testing channel. Must have been drunk at the time or something.
breun
23rd July 2006, 09:54 AM
If you could get that to work I think a lot of people would be very happy, Scott. Still I think this is really something SWsoft should be doing.
atomicturtle
23rd July 2006, 10:03 AM
We've been kicking it around for an ASL tie-in for a while now.
dom974
30th August 2006, 05:36 PM
Hi everyone,
totally right about suphp.
It's incredible, it should be activated by default. I'm so annoyed because my clients tell me "i don't know why but it works everywhere else"
I tried to search on the internet but it seems no one really succeeded...
bye
dominique.
benji
1st September 2006, 03:11 AM
Ok guys, now that vacations are over,
Shall we get this perm anoying thing going!
I've been like one year after this issue, still havent found a global solutions for this.
Atomic, i'm sure you know the solution for this, could you give us a light on this?
dom974
2nd September 2006, 06:53 PM
Hi,
Just a quick word to say that I've successfully installed suPHP on my Plesk8 box !!
It was pretty easy:
1/ yum install mod_suphp
2/ vi suphp.conf in httpd directory
put suphp engine to on
put suphp config path to/etc/yoursuphp dir where you have your suphp.ini file
3/ vi httpd.conf
remove php handler because it's already used by suphp
4/ service httpd restart
... and that's all it works like a charm now !
bye
dominique.
benji
3rd September 2006, 08:13 AM
Hi dominique,
By the way, I'm still on plesk 7.5.4, in ur opinion how was de update to 8? Any problems on update? Any advises?
And, will this install of suPHP work also in plesk 7.5.4 ?
Tx very much.
dom974
3rd September 2006, 10:45 AM
hi benji,
I don't know for plesk 7.5. My plesk box has been plesk8 right from the start.
But as far as I know, I don't see why it shouldn't work. If you're running apache2/php4-5, that would work.
I just installed the rpm package made for fedora/rh and I didn't have to modify loads of things.
Once I got suphp to work (as a module for apache mod_suphp it's not compiled directly but loaded as a dso), I wasn't able to use my horde webmail.
So if it's your case, just put something like that in your httpd.conf file:
<Directory /usr/share/psa-horde>
php_admin_flag engine on
suPHP_Engine off
AddHandler php5-script .php
AddType text/html .php
</Directory>
don't forget the AddHandler directive otherwise mod_php is activated but it doesn't take in charge of php files (was my case)
dominique.
benji
3rd September 2006, 04:45 PM
Thanks a lot for ur info. I guess i will have to update to version 8 anyway, and put the suphp thingie, o well..., o probably a sunday plesk party (to ensure no clients are upset by the possible offline times) :)
Regards.
dom974
3rd September 2006, 04:56 PM
Yep, send me an email if you have issues while setting suphp at dwanhoi (at) gmail (dot) com
i won't connect to that forum very often
bye
dominique.
PS: clients and offline times during updates ... tricky very tricky, that's the worst thing I am experiencing, clients putting pressure on your shoulders
CryoGenID
27th September 2006, 02:56 PM
Hey!
I've read all threads regarding the suPHP and tried to install it myself...
But I am stuck :-(
The current status is that when I run a PHP-Script, I get a "500 Internal Server Error".
What I did was to rename /etc/httpd/conf.d/php.conf to php.xxx so that it is not processed any more.
(As suPHP calls PHP right?)
Then I edited /etc/httpd/conf.d/suphp.conf .
This is the current suphp.conf:
---
# This is the Apache server configuration file providing suPHP support..
# It contains the configuration directives to instruct the server how to
# serve php pages while switching to the user context before rendering.
# For directives see <URL:http://httpd.apache.org/docs-2.0/mod/mod_suphp.html>
LoadModule suphp_module modules/mod_suphp.so
# To use suPHP to parse PHP-Files
#AddHandler x-httpd-php .php
AddHandler x-httpd-php .php .php4 .php3 .phtml
#AddHandler php5-script .php
#AddType text/html .php
# This option tells mod_suphp if a PHP-script requested on this server (or
# VirtualHost) should be run with the PHP-interpreter or returned to the
# browser "as it is".
suPHP_Engine on
# This option tells mod_suphp which path to pass on to the PHP-interpreter
# (by setting the PHPRC environment variable).
# Do *NOT* refer to a file but to the directory the file resists in.
#
# E.g.: If you want to use "/path/to/server/config/php.ini", use "suPHP_Config
# /path/to/server/config".
#
# If you don't use this option, PHP will use its compiled in default path.
#suPHP_ConfigPath /etc
# If you compiled suphp with setid-mode "force" or "paranoid", you can
# specify the user- and groupname to run PHP-scripts with.
# Example: suPHP_UserGroup foouser bargroup
# suPHP_UserGroup apache apache
---
When I look into the suphp.log-File I see s.th. like this which looks perfectly correct:
---
[Wed Sep 27 20:53:13 2006] [info] Executing /var/www/vhosts/xxx.com/httpdocs/who.php as user xxx_com (10001), group psacln (10001)
---
Why am I getting the "Internal Server Error"?
I think it has somehow s.th. do to with the "AddHandler"/"AddType" in the suphp.conf. If I play around with those,
I either get the "Internal Server Error" or absolutely no output is displayed :(
Do I need to check s.th. regarding PHP? (When I type "php -v" on the console, php answers this here:
----
PHP 5.0.4 (cli) (built: Jan 29 2006 21:37:43)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
with eAccelerator v0.9.4, Copyright (c) 2004-2004 eAccelerator, by eAccelerator
----)
Can please anybody help me? I need the suPHP to get Typo3 4.0 working correctly...
Thanks a lot in advance!
Chris
regen
19th October 2006, 02:46 PM
When I look into the suphp.log-File I see s.th. like this which looks perfectly correct:
---
[Wed Sep 27 20:53:13 2006] [info] Executing /var/www/vhosts/xxx.com/httpdocs/who.php as user xxx_com (10001), group psacln (10001)
---
Why am I getting the "Internal Server Error"?
wrong GROUP, check out 'psaserv' as group.
ptnetworks
1st December 2006, 06:13 PM
yum mod_suphp does not find any packages, i have Centos 4.2
Can i download it from some place?
Thanks,
Ruben
breun
2nd December 2006, 06:39 AM
Both dag.wieers.com and centos.karan.org have mod_suphp packages for RHEL/CentOS 4. See http://dag.wieers.com/packages/mod_suphp/ for instance. Or just add Dag's channel to your yum configuration, then you can install it using yum (and keep it up to date).
ptnetworks
2nd December 2006, 09:57 AM
It worked, now can i do the same thing for php5 ?
When i change the suphp.conf settings mysql stops working in php, only scripts that do not use mysql work, any ideas?
Regards
Ruben
dom974
4th December 2006, 03:04 AM
what errors does the php page give you ?
What user/group did you put in your suphp.conf ?
Dominique.
Pureweb.fr
thewolf
4th December 2006, 07:11 AM
Hi,
We're also considering to install suPHP on our RHEL4 servers running Plesk 8.0.
Is there anything we should know (e.g. things that may break) before we proceed?
Also, SWsoft should really include suPHP into Plesk!
Thanks.
dom974
4th December 2006, 07:17 AM
I don't think suphp should be installed _by default_.
I assume there will be too many questions like : why is chmoding 777 giving me errors ? why is webdav not working properly, etc ...
but they should definitely include this option like "safe mode" option in hosting configuration.
there's nothing to take care of before installing suphp. If you have loads of files already in your apache folders, just make sure user id of the owner won't be rejected by suphp after the install (make a script to change thoses perms)
thewolf
4th December 2006, 07:36 AM
Originally posted by dom974
I assume there will be too many questions like : why is chmoding 777 giving me errors ? why is webdav not working properly, etc ...
Hi,
Could you expand a bit on why suPHP could cause that kind of errors?
Thanks.
dom974
4th December 2006, 07:59 AM
By using mod_suphp, this will change your permissions system.
suPHP allows pages to run as YOUR user (instead of the "nobody" or "apache" user), which means files no longer have to be chmodded to world writable (777/666) for the webserver to be able to write.
The news 777 is now 755
Trying to put 777 will (normally) result in getting errors when running scripts (that's a suphp security because you should not have to use 777 anymore)
As for things like webdav, you would use it as a mod_dav, which is outside the suphp perimeter, and so it won't create files within users permission but apache permissions.
Upload a php page using webdav, and then try to access it, suphp will complain and exits because file is not owned by your user
DavidCollom
5th December 2006, 07:39 AM
I attempted to use mod_suPHP on Fedora Core 4 from (http://dries.ulyssis.org/rpm/packages/mod_suphp/info.html)
however when i tried to configure it all page source was being downloaded and no error logs or anything was working.
since then i have removed the packaged and it is still continuing to output page sources
I have renamed the php.conf back and i can access some sites with the filename (E.G: index.php) but when i try and access just a domain it downloads the file. could someone point me in the right direction or tell me where i should check for more specific errors.
breun
5th December 2006, 07:47 AM
What are the contents of your /etc/httpd/conf.d/php.conf?
DavidCollom
5th December 2006, 07:50 AM
I think ive got it working... possably Firefox and IE Cache's but im unsure
my php.conf file is:
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php5_module modules/libphp5.so
#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler application/x-httpd-php .php
AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
Not sure whats needed and what aint for normal operations but firefox was saying it was application/x-httpd-php so i added it to try and see if it would work.
breun
5th December 2006, 08:05 AM
A basic CentOS 4/PHP 4 non-suPHP php.conf looks like this:
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php .php4 .php3 .phtml
DirectoryIndex index.php index.php3
The AddType statement voor application/x-httpd-php is definitely needed.
DavidCollom
5th December 2006, 08:11 AM
ok great,
i think it might have fixed its self. so far ive had no clients complaining and i even go one client to browse my website just to make sure trying all combernations of subdomains file names etc.
if any one you's want to see if its working/or not.
these are the sites/problems im having
http://david-collom.co.uk (http://david-collom.co.uk/)
http//www.david-collom.co.uk (http://www.david-collom.co.uk)
http//www.david-collom.co.uk/index.php (http://www.david-collom.co.uk/index.php)
unsichtbarre
17th March 2007, 03:30 PM
Hi everybody. I would like to get suphp working on my server because I too am tired of my few users saying "but I can do that everywhere else" with reference to files processed by Apache. I followed the excellent directions by dom974, but ran into some issues. Hopefully, someone can point to where I went wrong:
1. I installed suphp (no apparent problem) with yum: $yum install mod_suphp
2. I edited suphp.conf in httpd/conf.d/: $vi suphp.conf
>suPHP_engine on
3. could not find suphp.ini in any directory: $find / -iname *suphp*
4. could not find php handler in httpd.conf
Did I miss something simple? Any help appreciated in advence.
-John
Originally posted by dom974
Hi,
Just a quick word to say that I've successfully installed suPHP on my Plesk8 box !!
It was pretty easy:
1/ yum install mod_suphp
2/ vi suphp.conf in httpd directory
put suphp engine to on
put suphp config path to/etc/yoursuphp dir where you have your suphp.ini file
3/ vi httpd.conf
remove php handler because it's already used by suphp
4/ service httpd restart
... and that's all it works like a charm now !
bye
dominique.
CrK01
23rd March 2007, 12:00 PM
Hello,
I tried to install this.
But it gets an error ( 500 )
Logs show this:
[Fri Mar 23 16:34:28 2007] [error] [client xxx.xxx.187.31] /usr/sbin/suphp: error while loading shared libraries: libc.so.6: failed to map segment from shared object: Cannot allocate memory, referer: http://xxx.host.com/index.php ( example )
it's a fedora core 4 BOX , 2 GB RAM and all well at all
Ski_K2
30th March 2007, 01:21 PM
Originally posted by dom974
Hi,
Just a quick word to say that I've successfully installed suPHP on my Plesk8 box !!
It was pretty easy:
1/ yum install mod_suphp
2/ vi suphp.conf in httpd directory
put suphp engine to on
put suphp config path to/etc/yoursuphp dir where you have your suphp.ini file
3/ vi httpd.conf
remove php handler because it's already used by suphp
4/ service httpd restart
... and that's all it works like a charm now !
bye
dominique.
Which OS did this work on?
scraane
17th November 2007, 03:05 AM
Could anyone tell me how to install suPHP on suse 10.1? I have the .rpm file and it is installed, but what now?
lvalics
24th December 2007, 06:47 AM
For those who concern on mod_suPHP, Power Toys now modify the vhost.conf propeerly and also add a small php.ini into user httpdocs.
Also we detect in new version (4.3.0) if you have mod_suPHP enabled and then we add to skeleton (if you wish), this will help you to not enable to all domains, it will be enbled by default. Working well on some tested servers, especially Joomla guys love this feature :-)
lvalics
23rd January 2008, 08:37 AM
When i change the suphp.conf settings mysql stops working in php, only scripts that do not use mysql work, any ideas?
Maybe for some will be imp. information, for us took 1 day to found it.
The problem is that for some reason the extensions are not loaded if mod_suphp is enabled.
We found this problem on Debian (Ubuntu) only, not on RedHat, could be that is just on some servers happennig.
The solution is to add to each php.ini (maybe in skeleton) to load extensions also from there not only in /etc/php.ini
Work for us - hope this help.
vBulletin® v3.6.12, Copyright ©2000-2008, Jelsoft Enterprises Ltd.