cancel
Showing results for 
Search instead for 
Did you mean: 

[PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

MarkA
Newbie
Posts: 11
Registered: ‎23-10-2008

[PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

Going through the challenges of migrating a working Joomla site from CCGI to PAYH. Bear with me, I'd consider myself relatively handy with MS stuff (MCSE) but bordering on the dangerous in Unix/Apache/PHP... Here is the fallout, any answers readily welcomed!
1. It seems PHP safe mode is ON on plesk-host02 but OFF on plesk-host03. As such, the Joomla auto application install in Plesk fails on host02. Why the discrepancy? Can it be turned on/off at a user level as suggested in the permissions section of the Plesk control panel?
2. Running scripts from a browser (like most CMS sites do during initial setup) configures folders and files with the user 'www-data' and rwx r-x r-x permissions. Trying to amend these using an FTP client or through Plesk isn't possible since you're logged in with a different account. These permissions appear too restrictive to complete tasks. In my case I'm trying to restore a Joomla site using JoomlaPack/Kickstart and it's bombing out with "Could not open installation/gpl.html for writing", presumably because the directories the kickstart.php script creates with the www-data user don't have the write permissions for group/others? I realise this has been covered in some other threads but only briefly and without a solid conclusion.
3. Isn't it time for a dedicated forum?  Grin
I'm sure this will raise more questions, I'll fill in the blanks as they come up!
Mark.
45 REPLIES 45
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

In my host03 account, I have "PHP safe mode management: No". The master value is on, but my local value is off (fortunately). Admin should be able to set the relevant php_admin_flag for each user.
You should be able to duplicate files with user www-data and then set the permissions on the copy.
Gabe
scubarew
Grafter
Posts: 43
Registered: ‎31-07-2007

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

I have exactly the same problems migrating my joomla site and I have no idea who to ask to get the PHP Safe Mode turned off.
Joomla is pretty much the only reason I'm testing the new setup so I'm stalled for now.
Kev_Mawson
Grafter
Posts: 196
Registered: ‎05-04-2007

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

Hi
This has now been enabled, so you can choose to have this switched on or off, to do this, log in to your plesk control panel, click home, click on to the domain, click setup and move down to the page to php safe mode.
MarkA
Newbie
Posts: 11
Registered: ‎23-10-2008

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

Quote from: Kev
Hi
This has now been enabled, so you can choose to have this switched on or off, to do this, log in to your plesk control panel, click home, click on to the domain, click setup and move down to the page to php safe mode.

Thanks Kev, restore of the Joomla site from a different host worked well. Just gotta understand the permissions/www-data thing a bit better and I'm there!
scubarew
Grafter
Posts: 43
Registered: ‎31-07-2007

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

That's really helped me too. Everything is up and running now so I'm more than happy.
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

Quote from: MarkA
Just gotta understand the permissions/www-data thing a bit better and I'm there!

I'm not a Joomla user, but if group and owner are www-data and only scripts need write permission, 755 should be fine. If others need write permission, you could use a php script such as:
<?php
chmod("/pathto/yourfile", 0777);
echo "Done";
?>
Gabe
MarkA
Newbie
Posts: 11
Registered: ‎23-10-2008

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

I'm still struggling with this, anyone help? Changing permissions on the files doesn't seem to make any difference, when scripts run they fail until I change the folder owner to the user setup as default rather than the www-data user. I notice the default user is member of the root group, versus www-data which is a member of www-data, is this a member of the least secure 'others' group?
The only workaround I can find is to go into Plesk filemanager, rename each folder beneath httpdocs, then copy it to the same location with the original name. This has same permissions but different owner, then the various Joomla plugins work again. I'm left with lots of old folders that can't be removed, even via Plesk as they come back with Permission Denied errors.
I can't help feeling I'm missing a simple solution. Have tried chown via PHP script, but since that runs under the www-data user (I think!) it doesn't have sufficient permission to do anything. Shell access would help  Tongue Cheesy
Does this all stem from restoring the site from another host or is it the same if doing a fresh install? I tend to think it would be the same?
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

As I say, I'm not a Joomla user, so I'm slightly in the dark, but:
www-data is the web server, so, from the point of view of a file or folder not in its group, it needs 'other' permissions.
If you want to remove a file created by www-data, you will first need to chmod it 0777 using PHP, which runs as www-data in this setup. Then you can delete it by FTP. If you want to gain control of a file owned by www-data, first chmod it 0777, then duplicate it by FTP, then delete the original. If www-data still needs access, you will need to leave 'other' permissions set.
You can't use chown, because you're not root, but you can use chmod. (It might be possible for admin to give us limited chown under sudo.)
In the thread on using CRON to unpack a tar.gz, I give another method of running shell scripts via Perl. The key line is the qx(shell script) line. You'll notice that Perl variables are interpolated in this example, but if you want to protect shell variables from interpolation, you can substitute single quotes for the brackets.
There are ways of making php run as user (suexec, suphp, mpm-peruser...), but I don't know which, if any, play nicely with plesk. At the moment, (I think) we can't get Perl to talk to PHP properly because of the permissions issue. Running php as user would also be more secure: we have open_basedir protection, but there are ways...
Gabe
auldgrey
Newbie
Posts: 3
Thanks: 2
Registered: ‎10-11-2008

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

Hi
I am also trying to set up multiple Joomla instances but on plesk-host04 this time. When I go to set up on my domain I seem to only get the option to switch PHP support on or off and management of the option is switched off in permissions  Sad . Is this the same problem as MarkA and scubarew? If so could management of PHP safe mode be switched on for plesk-host04 please (or just switched off for me). Will this be done for future new hosts?.
Thanks, Jon Undecided
scubarew
Grafter
Posts: 43
Registered: ‎31-07-2007

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

The ability to turn Safe Mode on or off has been removed temporarily as it exposed some security issues which are being worked on. I don't know the exact details.
I've managed to restore my Joomla site to a new domain from scratch with Safe Mode on quite happily so it is possible, just not as easy as installing the Application in one step from Plesk.
perry
Dabbler
Posts: 12
Registered: ‎04-08-2007

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

JOOMLA!
I read an earlier posting and tried to turn safe mode off but this turns off PHP.
My Joomla (on several accounts I have on PAYH) were working beautifully even though I had to fiddle with chmod from time to time. Now with PHP safe mode seemed to have recently been forced to ON, I am completely snookered.
When trying to install a module via Joomla admin it cannot read/write the uploaded files as they belong to www-data.
I am desparate if I cannot fix this I have three PAYH accounts I will have to move elsewhere immediately.
scubarew
Grafter
Posts: 43
Registered: ‎31-07-2007

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

Perry,
Have you tried using the FTP mode of Joomla? I was never able to get this working uder the old CCGI platform but it works very well on PAYH and seems to overcome the Safe Mode issue. I uploaded several new components and modules to my site last night this way and it all worked perfectly.
perry
Dabbler
Posts: 12
Registered: ‎04-08-2007

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

Oh Dear
I can't even update the Global Configuration to enable the FTP. Same problem. configuration.php belongs to the account and the php script won't write to it. I suppose I could download the file and manually edit it but that's not really a long term solution for the other administrators.
Despite my delight with PlusNet and PAYH in the past I am really close to dumping it.
perry
Dabbler
Posts: 12
Registered: ‎04-08-2007

Re: [PAYH] Safe Mode ON and OFF, www-data, Joomla restore and so on...

Had to download configuration.php and manually edit it and upload to enable FTP
The (template) install seemed to process and then failed with unable to write file. Obviously it can't copy the files to the /templates/ directory.
Can someone please advise, I am completely stuffed.