4571 Posts in 1384 Topics by 1376 members
| Go to End | Next > | |
| Author | Topic: | 4102 Views |
-
cPanel hosting and file permissions

27 November 2009 at 7:33am
Does anyone have experience of setting up the owner and group permissions for SilverStripe in a cPanel environment? The only way I can get the site to run ok it seems is by enabling "read" and "execute" for "others". This suggests to me that the default cPanel "owner" or "group" isn't correct. I've tried changing the group and/or owner to "apache" but that doesn't seem to work any better.
Exactly what permissions are necessary for:
directories
files - php
files - css, jpg...etcExactly what user does SilverStripe need to run in a Linux/Apache environment?
Thanks.
Al
-
Re: cPanel hosting and file permissions

27 November 2009 at 8:48am Last edited: 27 November 2009 8:48am
Hi Albere,
We host our SS sites in a cPanel WHM production environment and have no such trouble. The owner and the group of all files are the same as the customer account.
Is this your own cPanel setup, or a host?
Aaron
-
Re: cPanel hosting and file permissions

28 November 2009 at 12:13am
It's Solar VPS who host it but I suppose it is our config to a degree (though we have stuck to best practice security). So you just use the cPanel account (in our case "hosting") as the owner and group? What permissions to you run? rwxrwxr-x? I'm not convinced that the php and config files should be readable or executable by "others". However they seem to need to be in order for Silverstripe to run.
-
Re: cPanel hosting and file permissions

28 November 2009 at 1:09am
Hi mate,
No the config and .htaccess on our production environment do not need to be world writable, although we don't install silverstipe on this server. The dev has been done by this stage so it's a matter of a simple upload really.
When I say client account, I mean that each client we host has their own account in cPanel. E.G. If you were one of our customers, I would create an account called "albere". After upload, all folders and files are owned by "albere" with the group "albere".
Folders: 0755, except for Assets and it's children, which are 0777
Files: 0644 in pretty much all cases.I get the feeling that groups aren't set up quite right on your system. For all money, we are using a very stock-standard cPanel install.
Aaron.
-
Re: cPanel hosting and file permissions

28 November 2009 at 1:18am Last edited: 28 November 2009 1:18am
Hi guys
I am having simpliar problems since moving from a reseller WHM account to a full blown VPS with root WHM access (i.e. the level above a reseller).
Previously when using the reseller account I never had to touch any permissions, but now when I either install or transfer a SS install from my local machine I have to fiddle with the permissions in assets and if installing then the .htaccess and _config.php to allow global access.
Double-A-Ron how do you go about quickly setting the default permissions on the assets folder and all it's child folders? If I set Uploads to 0777 then it works, but when new child folders are created they don't seem to inherit these permissions and revert back to 0755. Folders created by the DataObjectmanager seem to have permissions of 2775 and then they work for uploading through the DOM.
I must admit I am still rather confused by the whole permissions thing and am still pretty new when it comes to linux servers.
Is there somewhere in WHM that you can fiddle with groups and default folder permissions?
Thanks
Aram
-
Re: cPanel hosting and file permissions

28 November 2009 at 1:33am Last edited: 28 November 2009 1:34am
Hi Aram,
We generally don't have to fiddle with permissions at all. Our (rough) process is:
1. Dev in our own environment.
2. Upload to production server (cPanel account that was created in WHM prior)
3. Set Assets to 0777.That's it for us. We've never had issues with new folders being created within Assets, and we do have customers doing just that. Permission inheritance works just fine in our case and we have never had upload complaints or failed tests to the same effect.
We have a dedicated server running our production WHM.
The common denominator so far with you and albere seems to be VPS. I am wondering if there is some underlying permission issue that is worth investigating?
Aaron
EDIT: Aram, if we were to fiddle with any permissions at all, we would do so through either FTP client or SSH. But like i said, we only ever have to do this on the Assets folder once.
-
Re: cPanel hosting and file permissions

28 November 2009 at 1:46am
Hmm thats interesting, I guess the inheritance must be some setting somewhere. I will look into it a bit more, thanks for your help
-
Re: cPanel hosting and file permissions

28 November 2009 at 11:44am
I recently had to setup 2 Silverstripe installations on linux webservers with cPanel. Both worked in slightly different ways.
The first, I set up the owner to be the apache user, which runs as the user "nobody". The group was set to be the user/ftp account, giving the following look - drwxr-xr-x 10 nobody actionseo 4096 Oct 6 14:44 cms.
files ran as 644 -rw-r--r-- 1 nobody nobody 661 Oct 12 14:30 _config.phpThe second setup ran the other way with the user/ftp account setup as the owner with the apacher user "nobody" as the group.
In case neither of the above work set the user and group to both be user/ftp account.
In neither case did I have to change the file permissions of the Installation, just the ownership via chown -R.
Good luck.
Chris
| 4102 Views | ||
| Go to Top | Next > |




