Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 22nd October 2012, 14:02
darkangel darkangel is offline
Member
 
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
Default Is it safe to disable open_basedir? (Fast-CGI + suEXEC + Suhosin)

Hi,

I need to disable PHP's open_basedir for performance reasons – is it relatively safe to do this on a dedicated server with Fast-CGI, suEXEC, and Suhosin?

What are the considerations?

Thanks.

Last edited by darkangel; 22nd October 2012 at 14:15.
Reply With Quote
Sponsored Links
  #2  
Old 23rd October 2012, 16:11
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,685
Thanks: 1,899
Thanked 2,599 Times in 2,448 Posts
Default

No, this is not safe because you can read all kinds of other files outside the website's document root from a PHP script.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 23rd October 2012, 16:53
darkangel darkangel is offline
Member
 
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
Default

Only files readable by that particular web user (e.g. "web1"), right? Things like log files?

And this is only an issue if you have vulnerable code?

I needed to disable it because of this bug with PHP.
Reply With Quote
  #4  
Old 23rd October 2012, 17:22
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,066
Thanks: 697
Thanked 4,248 Times in 3,260 Posts
Default

Quote:
Only files readable by that particular web user (e.g. "web1"), right? Things like log files?
All files that are readable by the web[id] user, client[id] group or that are world readable like some config files in /etc.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 23rd October 2012, 21:53
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 335
Thanks: 24
Thanked 43 Times in 39 Posts
Default

Out of curiosity (and I'm not necessarily saying you're wrong), what has lead you to conclude that PHP's open_basedir directive is hindering performance significantly?
Reply With Quote
  #6  
Old 24th October 2012, 09:44
darkangel darkangel is offline
Member
 
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
Default

Did you read the bug report that I linked to? It prevents the use of the realpath cache.
Reply With Quote
  #7  
Old 24th October 2012, 15:49
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 335
Thanks: 24
Thanked 43 Times in 39 Posts
Default

No, sorry, I had missed that hyperlink. After all, it is a bit small.

I ask only so that I, too, may be informed if there is a genuine performance problem with when safe_mode or open_basedir is used. I read every post in the bug report and it seems that there is indeed an issue at a significant level of scale.

Out of curiosity alone, are you actually hosting a sufficient number of sites to feel that performance hit? If so, how many sites?
Reply With Quote
  #8  
Old 24th October 2012, 18:35
darkangel darkangel is offline
Member
 
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
Default

I don't think it has anything to do with how many sites you're hosting (we only have 2 main websites). It would affect any PHP website, but mostly larger sites with lots of file includes (which we have).
Reply With Quote
  #9  
Old 24th October 2012, 19:22
cbj4074 cbj4074 is offline
Senior Member
 
Join Date: Nov 2010
Posts: 335
Thanks: 24
Thanked 43 Times in 39 Posts
Default

Right; that makes sense.

Have you run benchmarks to assess the performance impact of using safe_mode or open_basedir in your particular situation?

I'm curious just how much of an impact the inability to use the realpath cache might have. A percentage would be ideal, e.g., "Disabling safe_mode and open_basedir yields a 25% performance improvement."

Ultimately, I'm wondering at what point a server administrator should consider disabling safe_mode and open_basedir in favor of performance -- i.e., at how many require() and/or include() statements.

Obviously, this determination must be made on a case-by-case basis, and it will depend largely on how many and what type of sites occupy the server, but some basic guidelines would be most helpful.

If you're willing to share your findings, thank you in advance.
Reply With Quote
  #10  
Old 24th October 2012, 19:39
darkangel darkangel is offline
Member
 
Join Date: May 2011
Location: Cape Town, South Africa
Posts: 49
Thanks: 6
Thanked 2 Times in 2 Posts
 
Default

I haven't done proper benchmarking, but you can find more information here:

http://php.webtutor.pl/en/2011/06/02...mple-solution/
http://blog.nexcess.net/2010/03/31/p...o-performance/
http://serverfault.com/questions/158...rmance-problem
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
ISPConfig 3.0.3.3 fresh instalation - email tab is empty artur_gib Installation/Configuration 13 16th March 2013 00:51
mpm-itk + suexec + php-cgi grungy Installation/Configuration 2 25th March 2010 22:17
/home ad symlink after rsync run DreamK General 4 8th March 2010 12:44
change fast cgi to mod php in ispconfig 3 clip Installation/Configuration 2 13th August 2009 09:12
CGI issue (SUExec as well maybe) MathieuMa Installation/Configuration 4 11th April 2006 09:59


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


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