Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 28th November 2006, 21:16
Rustin Rustin is offline
Junior Member
 
Join Date: May 2006
Location: Wisconsin, US
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default SuPHP for PHP4 and PHP5 with ISPConfig

Another great Falko howto: http://www.howtoforge.com/apache2_suphp_php4_php5

I'm wondering how to apply this feature in ispconfig.
We are moving all our hosting customers to ISPConfig and would love to have the ability to select which handler is used on a per vhost/customer basis.

I can't manually edit the vhost configs because if someone makes a change to the 'web' through the ISPConfig portal, the config will be rewritten, right?

What I would like to do is have ISPConfig output:
Code:
suPHP_Engine on
suPHP_UserGroup web1_username web1
AddHandler x-httpd-php4 .php .php4
AddHandler x-httpd-php5 .php5
suPHP_AddHandler x-httpd-php4
suPHP_AddHandler x-httpd-php5
instead of the code below when the 'suphp' option is set in config.inc.php
Code:
suPHP_Engine on
suPHP_UserGroup web1_username web1
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_AddHandler x-httpd-php
This way I could tell the end users to use a .php4 or .php5 extension on their files to decide which version of php to use.

Can anyone see why this would not work? If not, does anyone know where in the ISPConfig source files the suphp code is specified so I can change it?

Thanks in advance!

Rustin
Reply With Quote
Sponsored Links
  #2  
Old 29th November 2006, 05:19
Rustin Rustin is offline
Junior Member
 
Join Date: May 2006
Location: Wisconsin, US
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Figured it out.

By changing /root/ispconfig/scripts/lib/config.lib.php:
Code:
 if($go_info["server"]["apache2_php"] == 'suphp'){
                  $php .= "suPHP_Engine on\n";
                  $php .= "suPHP_UserGroup ".$webadmin." web".$web["doc_id"]."\n";
                  $php .= "AddHandler x-httpd-php .php .php3 .php4 .php5\n";
                  $php .= "suPHP_AddHandler x-httpd-php\n";
          }
to:
Code:
if($go_info["server"]["apache2_php"] == 'suphp'){
                  $php .= "suPHP_Engine on\n";
                  $php .= "suPHP_UserGroup ".$webadmin." web".$web["doc_id"]."\n";
                  $php .= "AddHandler x-httpd-php4 .php .php4\n";
                  $php .= "AddHandler x-httpd-php5 .php5\n";
                  $php .= "suPHP_AddHandler x-httpd-php4\n";
                  $php .= "suPHP_AddHandler x-httpd-php5\n";
          }
And following the Falko howto, it now will create vhost configs that suphp with php4-cgi and php5-cgi depending on the file extension (assuming you have the option enabled in /home/admispconfig/lib/config.inc.php).
Maybe I should make a proper addition to the tips/tricks section?
Reply With Quote
  #3  
Old 29th November 2006, 08:52
Berry Berry is offline
Member
 
Join Date: Nov 2006
Posts: 69
Thanks: 10
Thanked 1 Time in 1 Post
Send a message via Skype™ to Berry
 
Default

Quote:
Originally Posted by Rustin
And following the Falko howto, it now will create vhost configs that suphp with php4-cgi and php5-cgi depending on the file extension (assuming you have the option enabled in /home/admispconfig/lib/config.inc.php).
Maybe I should make a proper addition to the tips/tricks section?
Thanks for tipp, I was searching for this!
Yes, add it to tips&tricks!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php5 and php4 at the same time Hans Installation/Configuration 15 22nd October 2008 13:02
ispconfig breaks php5 in apache ? Randy Installation/Configuration 2 28th October 2006 12:20
fastcgi and php with ispconfig tosser Tips/Tricks/Mods 3 25th June 2006 21:01
eaccelerator installation - can't find php5-config tom Programming/Scripts 9 15th May 2006 15:36
SP-Server Setup - Ubuntu 5.10 "Breezy Badger" - Page 6 (changes) LuisC-SM HOWTO-Related Questions 0 21st April 2006 15:16


All times are GMT +2. The time now is 04:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.