• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

How to suphp 0.6.1

BDMM

Basic Pleskian
Here we go

DOWNLOAD AND INSTALL

wget http://www.suphp.org/download/suphp-0.6.1.tar.gz
tar -zxvf suphp-0.6.1.tar.gz
cd suphp-0.6.1
./configure --with-prefix=/usr --with-apxs=/usr/sbin/apxs --with-min-uid=500 --with-min-gid=500 --with-apache-user=apache --with-php=/usr/bin/php --with-setid-mode=owner --prefix= --exec-prefix=/usr
make
make install

I did have a few problems with the makefile not adding the conf files so added manually

pico /etc/suphp.conf

[global]
logfile=/var/log/httpd/suphp_log
loglevel=info
webserver_user=apache
docroot=/
env_path=/bin:/usr/bin
umask=0077
min_uid=500
min_gid=500

; 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

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php

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


I modified this so that I could enable it on virtual sites only through the vhost.conf files.

pico /etc/httpd/conf.d/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.

LoadModule suphp_module modules/mod_suphp.so

# 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 off


Then to enable on a per domain/directory basis. If you have problems with sitebuilder or horde I would suggest you check out other threads to disallow directories. I only enable it on admin directories because this is basically where files get uploaded or modified.

pico /home/httpd/vhosts/<domain>/conf/vhost.conf

ADD

<Directory /home/httpd/vhosts/<domain>/httpdocs/<directory>
php_admin_flag engine on
suPHP_Engine On
suPHP_ConfigPath "/etc/phpvirtual/<domain>"
#suPHP_UserGroup owner group ## ONLY FOR paranoid MODE
AddHandler x-httpd-php .php
AddHandler x-httpd-php .php .php4 .php3 .phtml
suPHP_AddHandler x-httpd-php
</Directory>


And finally create a directory to store php.ini files. I suppose it could be in the conf directory however I chose to create a seperate directory under /etc/phpvirtual/<domain.com>

cp /etc/php.ini /etc/phpvirtual/<domain.com>/php.ini

Modify the new php.ini as needed.

Thats it.

Alternatively you could install the [dag] mod_suphp via yum. This is compiled in paranoid mode and you will need to modify the suphp.conf files accordingly. I did have some problems with Handlers.


BD
 
It seems i dont have apxs installed ?

I'm running Plesk 7.5.4 on RH 9.0

Anyone else ?
 
I've installed the httpd-devel rpm now , and now i get following :

configure: error: APR is needed to build mod_suphp for Apache 2.x but was not found

How to proceed ?


Thanks in advance for your help
 
> rpm -q apr
apr-0.9.7-1

Is installed now.
Same deal
Still saying apr is needed ?
 
I have installed suPHP on my suse 9.3 box. But after make install there was no conf file in /etc. Is that normal ?

The second problem that i have is that php is useing cli. Do i need to re compile php for the cgi mode ?
 
Originally posted by w0uter
I have installed suPHP on my suse 9.3 box. But after make install there was no conf file in /etc. Is that normal ?

It seems that way. Follow the instructions above from the pico /etc/suphp.conf which creates the suphp.conf file.

You may also need to add the /etc/httpd/conf.d/suphp.conf file

Originally posted by w0uter
The second problem that i have is that php is useing cli. Do i need to re compile php for the cgi mode ? [/B]

Not sure on this one.
 
Originally posted by BDMM
It seems that way. Follow the instructions above from the pico /etc/suphp.conf which creates the suphp.conf file.

You may also need to add the /etc/httpd/conf.d/suphp.conf file

I have made both conf files. But suPHP dont do anything.... I think i first most find out if i have to recompile PHP for the cgi mode.

I see this in the phpsu faq:
You probably have installed the CLI version of PHP, but you need the CGI version. Copy the file /build/path/sapi/cgi/php to /where/ever/you/have/installed/bin/php to use the CGI version.

But i dont understand what i most copy...
 
Hi!
When i activate suPHP, then my PHP files get an 500 Internal Server Error. What could be wrong ?
 
in the suphp.conf file you may have to set it to use php-cgi depends on which version of php you are using

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php-cgi
 
this line i have allready in my suPHP.conf.
when its activated i get an 500 error
when its not activated i get also a 500 error...
 
ups! php is not installed as cgi, when php-cgi is not there?
can you give me a hint, how to compile php as cgi?
 
I upgraded to atomicrockets php 5.0.4.

However try changing the suphp.conf file to

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php

ie non cgi version.

Did you follow the instructions from thread to setup suphp? where are you suphp.conf files

/etc/suphp.conf
/etc/httpd/conf.d/suphp.conf
 
yes, i have followed the instructions.
i have one suPHP.conf in /etc and one in /etc/apache2/conf.d

in the suPHP.conf i have tried:

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php

and

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php4
 
These are my files running with standard plesk php

/etc/suphp.conf
================

[global]
logfile=/var/log/httpd/suphp_log
loglevel=info
webserver_user=apache
docroot=/
env_path=/bin:/usr/bin
umask=0033
min_uid=500
min_gid=500

; 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

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php

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


/etc/httpd/conf.d/suphp.conf
==========================
LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine off
==========================

and my vhost.conf file for the site I want php to work in

============================
<Directory /home/httpd/vhosts/domain.com/httpdocs>
php_admin_flag engine on
suPHP_Engine On
suPHP_ConfigPath "/etc/phpvirtual/domain.com"
AddHandler x-httpd-php .php
AddHandler x-httpd-php .php .php4 .php3 .phtml
suPHP_AddHandler x-httpd-php
</Directory>
============================

And I also have php.ini file in
/etc/phpvirtual/domain.com/php.ini

Also what version of php are you using and is it in /usr/bin folder
 
Hi,

thanks!

My suPHP.conf:
[global]
logfile=/var/log/apache2/suphp_log
loglevel=info
webserver_user=www-data
docroot=/
env_path=/bin:/usr/bin
umask=0077
min_uid=500
min_gid=500

; 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

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php

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

My vhost.conf:
<Directory /var/www/vhosts/mydomain.com/httpdocs>
php_admin_flag engine on
suPHP_Engine On
suPHP_ConfigPath "/etc/phpvirtual/mydomain.com"
AddHandler x-httpd-php .php
AddHandler x-httpd-php .php .php4 .php3 .phtml
suPHP_AddHandler x-httpd-php
</Directory>

my /etc/apache2/conf.d/suphp.conf
LoadModule suphp_module /usr/lib/apache2/modules/mod_suphp.so

# 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 off

An i also have a /etc/phpvirtual/domain.com/php.ini

By the Way:
i have also a little other problem with php.
Things like Horde a perfect in functionality. But i have several problem with scripts. when i want to open them, i'll get a download prompt. i have a info.php and a test123.php. both have this code:

<? phpinfo() ?>

the test123.php shows me the php infopage. the info.php wanted to be downloaded....

when i want to use php without suPHP, i have to insert the following code to the vhost.conf:

# php_admin_flag engine on
# php_admin_flag magic_quotes_gpc off
# php_admin_flag safe_mode off
# php_admin_value open_basedir "/var/www/vhosts/mydomain.com/httpdocs:/tmp:/usr/share/doc"

i have upgraded my php to 4.4.4. so i think there a several problems,...
 
try changing

LoadModule suphp_module /usr/lib/apache2/modules/mod_suphp.so

to

LoadModule suphp_module modules/mod_suphp.so

If I recall I had some issues with this until I changed the path.
 
By the Way:
i have also a little other problem with php.
Things like Horde a perfect in functionality. But i have several problem with scripts. when i want to open them, i'll get a download prompt. i have a info.php and a test123.php. both have this code:

<? phpinfo() ?>

the test123.php shows me the php infopage. the info.php wanted to be downloaded....


This may just be a cache problem. If php works for one page it should work for the other.
 
Back
Top