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

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th July 2010, 10:10
HungiTi HungiTi is offline
Junior Member
 
Join Date: Jul 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Enable/disable safe_mode in mode Fast-CGI for websites

Hi everybody,

Safemode is not used in ISPConfig 3 as it is marked as deprecated by the PHP developers and will be removed from new php versions, but someone want enable it in old php versions, please follow intructions:

* Notice: Only used for php mode Fast-CGI.

1. Run mysql text on dbispconfig database:
Code:
ALTER TABLE `web_domain` ADD `safemode` ENUM( 'Off', 'On' ) NOT NULL DEFAULT 'On' AFTER `suexec` ;
UPDATE web_domain set safemode='Off';
2. Add below code after row 170 in file /usr/local/ispconfig/interface/web/sites/form/web_domain.tform.php:
PHP Code:
'safemode' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'On',
'value' => array(=> 'Off',=> 'On')
), 
3. Add below html after row 73 in file /usr/local/ispconfig/interface/web/sites/templates/web_domain_edit.htm:
HTML Code:
<div class="ctrlHolder">
<p class="label">Safe Mode</p>
<div class="multiField">
{tmpl_var name='safemode'}
</div>
</div>
4. Add text below after row 15 in file /usr/local/ispconfig/server/conf/php-fcgi-starter.master:
Code:
-d safe_mode=<tmpl_var name='safemode'> \
5. Add code below after row 720 in file /usr/local/ispconfig/server/plugins-available/apache2_plugin.inc.php:
PHP Code:
$fcgi_tpl->setVar('safemode',escapeshellcmd($data["new"]["safemode"])); 
Sample picture

Finish, test again, good luck.
Reply With Quote
Sponsored Links
  #2  
Old 29th July 2010, 10:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,419
Thanks: 812
Thanked 5,205 Times in 4,081 Posts
Default

Please be aware that you can not install any ispconfig updates after you modified the web_domain table like this. Every future ispconfig udate will fail with a empty database.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 29th July 2010, 10:48
HungiTi HungiTi is offline
Junior Member
 
Join Date: Jul 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I agree with you.

Because I'm using old PHP version (5.2.14) (I upgraded to PHP 5.3.3 but unsuccessful) and want more security, so I prefer to safe_mode on.

With a similar way, I've added disable_functions (in php mode Fast-CGI) in sites to more security on share hosting, I think add it into default new version ?

Thanks.

Last edited by HungiTi; 29th July 2010 at 10:51.
Reply With Quote
  #4  
Old 29th July 2010, 10:51
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,419
Thanks: 812
Thanked 5,205 Times in 4,081 Posts
Default

ISPConfig 3.0.3 has a function for custom php.ini settings for all php types (cgi,fcgi,suphp and mod_php) which can be used to set values like safemode.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 29th July 2010, 11:23
HungiTi HungiTi is offline
Junior Member
 
Join Date: Jul 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I use CentOS 5.5. Would you like tell me more detail about that in ISPConfig 3.0.3 ? It have in ISPConfig 3.2.2 ? Where I can set it ?

I tested in Apache directives on Sites tab, but unsuccessful. I search on internet and found a method (http://www.howtoforge.com/forums/sho...82&postcount=4). If ispconfig updates, I try to modify the fcgi starter script and master template again ? It will set default in new version ?
Reply With Quote
  #6  
Old 29th July 2010, 11:26
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,419
Thanks: 812
Thanked 5,205 Times in 4,081 Posts
Default

This is a feature of ISPConfig 3.0.3 and not 3.0.2.2, so you can not set it in 3.0.2.2 as this feature is not implemented in that version. For details of ISPConfig 3.0.3 Beta 1, please see release nostes in the ispconfig.org blog.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 29th July 2010, 11:34
HungiTi HungiTi is offline
Junior Member
 
Join Date: Jul 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much. Hope soon release version.
Reply With Quote
  #8  
Old 29th July 2010, 19:08
BorderAmigos BorderAmigos is offline
Senior Member
 
Join Date: Apr 2008
Location: San Diego & Tijuana
Posts: 302
Thanks: 26
Thanked 33 Times in 31 Posts
Send a message via MSN to BorderAmigos Send a message via Yahoo to BorderAmigos
Default

On the current versions can safemode be enabled/disabled via the apache directives on a per site basis?
__________________
System6Hosting.com, ISPConfig 3, Debian.
Reply With Quote
  #9  
Old 29th July 2010, 19:28
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,419
Thanks: 812
Thanked 5,205 Times in 4,081 Posts
 
Default

Quote:
Originally Posted by BorderAmigos View Post
On the current versions can safemode be enabled/disabled via the apache directives on a per site basis?
If you use mod_php in that site, then yes. Otherwise, no.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
BorderAmigos (29th July 2010)
Reply

Bookmarks

Tags
ispconfig 3.0.2.2, safe_mode

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
Intel 82815 Video Card & Ubuntu 8.10 harvey527 Kernel Questions 8 5th November 2010 14:51
500 Servier Misconfiguration and Fast CGI tbirnseth HOWTO-Related Questions 0 16th April 2010 23:21
change fast cgi to mod php in ispconfig 3 clip Installation/Configuration 2 13th August 2009 09:12
Haproxy + Lighttpd / fast cgi EazySnatch Installation/Configuration 0 29th September 2008 16:22
High Availability Samba cluster - DRBD + Heartbeat djalex Server Operation 58 25th May 2007 19:38


All times are GMT +2. The time now is 19:44.


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