Apache 2 + Php 4 + Php 5 + Suphp 0.6.1

thanks. it works.

is it possible to define different suPHP_ConfigPath for both PHP4 & 5?

for example:

suPHP_Engine on
suPHP_ConfigPath /usr/local/etc/php4/cgi/
suPHP_AddHandler x-httpd-php
suPHP_ConfigPath /usr/local/etc/php5/cgi/
suPHP_AddHandler x-httpd-php5


Maniak said:
Good question !

You may try to use this in PHP compilation:
 
could this break it

Ok,

What if I were to do the following after using your installation guide:
cd /usr/local/directadmin/customapache
./build all y or ./build php y

Would this break the changes that were made by your howto?

Have you suggested this configuration to directadmin so they could possibly add it to their build script so by default DA supports both versions?
 
I need someone to help out... we've had a server running with this configuration for a couple months, but I haven't been able to contact Maniak via email... he set this up.

Inadvertently, a php upgrade was done, and it borked the entire server. Fortunately, there's less than a handful of clients on it, but it's still offline.

Anyone get this working successfully care to take a stab at it? CentOS 4 ... standard DA install.

Please email me - or contact us through our homepage ... livechat.

Yes, I'm willing to pay for your time.

Maniak - if you see this, please contact me!

Thank you.
 
i cannot get php_admin_value open_basedir working on virtual host..

on each server i have apache1+php4 + php5 + suphp0.6.1

but its work on php4 + apache1


why ??
any clue ??

php_admin_value open_basedir /home/xxxx
/:/tmp/:/var/www/:/usr/local/lib/php/:/etc/virtual/
 
what do you do with the installation

php5 + php4 + apache1 + suphp0.6.1

all client can run this scripts :

with the code :

<?
echo file_get_contents("/etc/passwd");
?>

because php CGI dont reconize it in virtual_host :
php_admin_value open_basedir /home/xxxxx/:/tmp/:/var/www/:/usr/local/lib/php/:/etc/virtual/

big problem of security now..
i dont want run safe mode..

php_admin_value open_basedir work with PHP CLI but not CGI..
 
duke28 said:
i cannot get php_admin_value open_basedir working on virtual host..

on each server i have apache1+php4 + php5 + suphp0.6.1

but its work on php4 + apache1


why ??
any clue ??

php_admin_value open_basedir /home/xxxx
/:/tmp/:/var/www/:/usr/local/lib/php/:/etc/virtual/

all php_admin flag will work only running php in apache module
for running php in cgi mode (suPHP) you need to set it globally in php.ini

for open_basedir you can lock only /home not /home/xxx because it's shared ini for every sites.
 
Hi,

duke28 said:
i cannot get php_admin_value open_basedir working on virtual host..

on each server i have apache1+php4 + php5 + suphp0.6.1

but its work on php4 + apache1


why ??
any clue ??

php_admin_value open_basedir /home/xxxx
/:/tmp/:/var/www/:/usr/local/lib/php/:/etc/virtual/

You cannot use php_admin_value with suPHP.

There is anyway a good way to prevent it, you can build a php.ini for each user with a very strong security.

Create a php.ini for each user and inside give this :

open_basedir = "/home/youruser/:/usr/local/php4/lib/php/:/var/www/html:/usr/local/directadmin/data/skins/:/tmp"

I will maybe write a little script that create a php.ini for new and old users, but for now I don't have time.

Enjoy !
 
Hi all,

I 'downgraded' to mod_php again because of some restrictions of suphp BUT both /phpMyAdmin and /webmail return errors about not being able to access /tmp (either for session or caching).

In order to downgrade I just followed the customapache approach and ended up with a 'clean' install.

I remember chown'd /var/www/html to apache:apache as a safer alternative to using min_uid=0, could this have any effect on this?

To be sure, I chown'd /var/www/html back to 0:0 but webmail still doesn't work.

I then chmod 777 /tmp to be sure and phpMyAdmin came back up, webmail is still giving me trouble.

When I access squirrelmail directly it returns 'Preference file, ../data/admin.pref.tmp, could not be opened. Contact your system administrator to resolve this issue.'

All this from https://ip/phpMyadmin(/webmail,/squirrelmail)

Any idea where I messed up? I'm pretty sure it must have been during the whole process of setting up suPhp...
 
Hi,

Have you removed :

LoadModule suphp_module /usr/lib/apache/mod_suphp.so

AddModule mod_suphp.c

AddHandler x-httpd-php .php .inc .php4
AddHandler x-httpd-php5 .php5

<Location />
suPHP_Engine on
suPHP_ConfigPath /usr/local/etc/php5/cgi/
suPHP_AddHandler x-httpd-php
suPHP_AddHandler x-httpd-php5
</Location>

and sure that PHP is working well (that mod_php is working).

If needed check how to configure your modules from the file /etc/httpd/conf/httpd.conf.original

Try also :

sh /usr/local/directadmin/scripts/webmail.sh
sh /usr/local/directadmin/scripts/squirrelmail.sh
 
Hi,

thanks for your swift reply! (and this how-to ofcourse)

I downgraded squirrelmail to 1.4.7 (was 1.4.8) and it works again.

Pretty strange... :s

Your tip about webmail.sh came in handy though! Didn't know about this yet.

But my problem is solved so I'm sorry I bothered you, had a bit of a panic there ;).

Thx for your time!!
 
Last edited:
The following problem:
does not work for me php after installation SuPHP When I come on a site it begins Download a file
If I do:
suPHP_Engine off RemoveHandler .php RemoveHandler .php5 All works except SuPhp :(
(apache1.3-FreeBsd5.5-php-4.4.4
I Did all under the instruction
 
Hi,

dj86 said:
The following problem:
does not work for me php after installation SuPHP When I come on a site it begins Download a file
If I do:
suPHP_Engine off RemoveHandler .php RemoveHandler .php5 All works except SuPhp :(
(apache1.3-FreeBsd5.5-php-4.4.4
I Did all under the instruction

- What says the logs (apache; in case turn to debug the log level)?
- Have you set the UID/GID to 0 ?
 
Still have customers need Zend Optimizer. Can we just run './build zend' twice with different php.ini path?
 
Hi,

I'm very green to the world of Linux and DA, so please forgive me for the dumb questions. :D

If I have already got the DA server running Apache 2.0.59, PHP 4.4.4 and Zend Optimizer 3.0.1, should I still follow the how-to and go through all the process to install php4 + php5 + suphp?

Or is there a way that I can just install php5 + suphp and make them work properly with the php4 + zend optimizer that are already installed?

After I got php5 running, how can I install zend optimizer for php5 only (as I got it working for php 4 already)?

Thanks for any advice! :)

Anthony.
 
Back
Top