cancel
Showing results for 
Search instead for 
Did you mean: 

[PAYH] Re rekabuk's post on Joomla and PHP Safe Mode

decomplexity
Rising Star
Posts: 493
Thanks: 26
Registered: ‎30-07-2007

[PAYH] Re rekabuk's post on Joomla and PHP Safe Mode

To avoid hijacking rekabuk's Joomla-specific thread....
DAK whether PN's Safe Mode = ON restriction is:
a. Because PN have identified significant security exposures in the general Apache / PHP environment and are more cautious than other hosting providers in relaxing this restriction
or
b. Because the PAYH Plesk distribution and implementation of Apache / PHP introduces an exposure which other hosting providers who do not use Plesk do not have
In other words, did an exposure appear in Apache / PHP which was not in CGI's 'separate' PHP environment, or it a necessary constraint of Plesk (or was it always there in CGI PHP but never plugged!) 
Zen from May 17. PN Business account from 2004 - 2017
6 REPLIES 6
Gabe
Community Veteran
Posts: 767
Registered: ‎29-10-2008

Re: [PAYH] Re rekabuk's post on Joomla and PHP Safe Mode

Please see previous posts on this subject. On ccgi, PHP scripts are handled by the CGI version of PHP. The scripts therefore run as your own user and safe mode is not necessary.
On PAYH/Plesk, PHP scripts are handled by the Apache-module version of PHP. The scripts therefore run as Apache's user (www-data) and any files or folders created by those scripts are owned by Apache. If everyone on a shared server is running scripts as www-data, you can't keep your own directories secure by discriminating on the basis of user. Instead, to avoid cross-site scripting on a shared platform running PHP as Apache module, you need the open_basedir restriction, which prevents everyone's scripts from operating outside their own specified directories. (If you can't lock anyone out, you have to lock everyone in.) The trouble is, various functions do not respect the open_basedir restriction. Safe mode disables those functions. You can disable the same functions without applying safe mode, but most of the problems with safe mode are caused by the absence of those functions, so you don't gain much. Under these conditions, safe mode doesn't make you safe from everyone else, it makes everyone else safe from you - so no opt outs.
When I first joined the PAYH trial, I was unaware of PAYH's history and assumed we were just testing a platform that was still being set up and would go live in April 09. It didn't bother me too much to find safe mode off locally, for the moment. When someone asked for safe mode to be turned off on their server and it was made a user option, I was just puzzled. Finally I realised that the platform was already live, and that there was a whole heap of sites that could so easily be hacked with serious consequences. I alerted Plusnet to the security situation and they turned safe mode back on.
There are alternatives (see previous posts), but Plusnet seem strangely attached to Plesk and (rightly) cautious about upgrading early. I've asked for clarification several times, but answer came there none. At present we don't know if hosting is even going to feature in some added-value package to go with Plusnet's new core packages, or if any legacy hosting will just be shunted off to the sister company and forgotten or dropped. PAYH seems underresourced. It's not encouraging.
What I'd like to see happen is ccgi be retained until PAYH is upgraded or otherwise made PHP-friendly (PHP as FastCGI by default).
Meanwhile, if anyone wants to run a CMS on PAYH without safe mode restrictions, they could try using the phpwrapper script. (Load and test the wrapper script before installing the CMS.)
Gabe
decomplexity
Rising Star
Posts: 493
Thanks: 26
Registered: ‎30-07-2007

Re: [PAYH] Re rekabuk's post on Joomla and PHP Safe Mode

Thanks Gabe. It was the security implication of being able to use FastCGI from Plesk 9 (or otherwise) which hadn't penetrated.
DYK if the performance hit of Apache being unable (by design) to handle more than one concurrent request over a single FastCGI connection was ever resolved?
Zen from May 17. PN Business account from 2004 - 2017
gollum
Grafter
Posts: 30
Registered: ‎30-07-2007

Re: [PAYH] Re rekabuk's post on Joomla and PHP Safe Mode

Gabe's explanation of the source of the problem is informative.
There is, however, another way of looking at this. It would appear that Plusnet may have made a poor decision about how to implement the new platform. The worrying aspect is that after several months there appears no plan to solve the problem or alternatively to just say "that is the way it is". There appears to be a lack of commitment to hosting and I have to worry that it will languish until it just disappears from the provision.
Retaining the old ccgi platform does not seem to be a way forward other than as a stop gap. In my experience the old ccgi servers were just too slow to offer a realistic CMS system even for development, which was all I wanted, never mind a user system.
I would like Plusnet to actually make a decision and tell us what it is. If there is to be no hosting then we can decide what we are going to do about finding alternative provision. If hosting is to be continued for marketing reasons but the service provided is to continue to be of little practical use, then tell us that (weasel words allowed as long as it is possible to read between the lines). If the long hinted at solution to the Safe Mode problem on PAYH is actually being worked on, then tell us the timetable for implementation.
As you may be able to tell, I am getting frustrated with the situation. I am looking for alternative hosting and then reassessing Plusnet as a connection only ISP. I am overall fairly happy with Plusnet connectivity - it is just this hosting situation which is driving me up the wall.
And, Gabe, I appreciate your wrapper solution but would prefer to have my CMS as described in the documentation - no surprises with plugins/modules etc. Lazy perhaps, but life is too short.
jelv
Community Veteran
Posts: 26,786
Thanks: 990
Fixes: 10
Registered: ‎10-04-2007

Re: [PAYH] Re rekabuk's post on Joomla and PHP Safe Mode

Have you not considered why hosting is not included in the current Plusnet products (except for existing users).
I think we have to face facts: Plusnet hosting is something they want to get rid off.
The only thing that puzzles me is the non-Plusnet users who are paying for PAYH hosting. They must be really happy with the hobbled service they have at present!
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
pjmarsh
Superuser
Superuser
Posts: 3,304
Thanks: 1,004
Fixes: 8
Registered: ‎06-04-2007

Re: [PAYH] Re rekabuk's post on Joomla and PHP Safe Mode

I have to agree with Jelv on that.  Also the paid for PAYH services are vastly overpriced.  I've only ever used any of Plusnet's offerings for "fun", and have all my serious hosting with another company, who I pay something similar to the PAYH Plus offering, but have a few more features than the PAYH Extra offers.  In my 6 years with this company I have had far fewer problems with my hosting than I have had with my PAYH site (which is far simplier than any of my proper sites), which I've been looking at for 10 months or so.  If I was paying for it, it would have moved my site away a long time ago.
Phil
Gabe
Community Veteran
Posts: 767
Registered: ‎29-10-2008

Re: [PAYH] Re rekabuk's post on Joomla and PHP Safe Mode

Hi decomplexity,
Sorry, I missed that question. Relative to mod_php, cgi takes a significant performance hit, but fastcgi maintains persistent processes and, depending on the configuration, slightly outperforms mod_php - and potentially offers distributed load balancing (separating the php server from the web server). The caution seems to be that if the config is not optimised you can get failed requests.
Hi gollum,
Given that some CMS components and plugins are incompatible with each other or with versions of the core or certain binaries, a surprise-free existence may be hard to find. Good luck. I would only suggest the wrapper to people who want to stick with PAYH and make use of what they're getting free/bundled. It's a stop-gap but, for me at least, it makes PAYH more useable now and gets my files and folders owned by my user, which is how I'd want them if we ever get FastCGI or a similar long-term solution.
Hi Phil,
Yup, that about sums it up.
Gabe