Page 1 of 1
apache ownership of files on server
Posted: Tue Jul 19, 2005 8:07 pm
by gwilsonmail
When I install a new blog, the install script creates /archives, /uploads, serendipity_config_local.inc.php and .htaccess with an ownership of "apache".
This means I cannot change permissions (chmod 777) and in some cases plugins fail. Plugins probably fail because of the permissions.
My virtual server is unix based and I use PLESK to access the files etc. I have no shell access available to me.
I can get my ISP to make changes to fix the problem but it's a real pain when upgrading and experimenting. Is the installation correct or do I have an apache or php configurartion problem?
Thanks.
PS I noticed sitemap.gz is also created with an ownership of "apache" so I can't delete it!
Re: apache ownership of files on server
Posted: Tue Jul 19, 2005 8:19 pm
by garvinhicking
It seems that the umask of the apache user does not allow others to read/write your files as your FTP user is not in the same group as your apache user.
You can, however, write a simple PHP script:
And then you can do everything you like.
Regards,
Garvin
Posted: Tue Jul 19, 2005 8:24 pm
by gwilsonmail
Thanks garvin.
That was particularly fast!
So perhaps it's a config issue with the isp. My virtual host account allows me to add/remove my own domains etc. So I would have thought This type of problem would not happen.
i have raised a trouble ticket with the ISP.
Thanks for the php snippet. I should be brave an write a script that does all the chmod stuff for a new install for me.
Posted: Tue Jul 19, 2005 8:43 pm
by gwilsonmail
Looks like I'm out of luck!
Warning: chmod(): Operation not permitted in /home/httpd/vhosts/gizmocha.com/httpdocs/xxxx/fix.php on line 3
Posted: Tue Jul 19, 2005 8:51 pm
by garvinhicking
Oh. Then you definitely need to check back with your provider and tell him about the problematic setup of his.
Regards,
Garvin
Posted: Tue Jul 19, 2005 11:14 pm
by gwilsonmail
They replied
"There is no other solution for this, than to let us know, and we will fix the ownership of files."
This may be an issue with virtual hosting, which is so common these days and at the price-point for blogging.
i have to admit at $2.95/mth for one domain and $4.95 for ~10 domains it's a good deal.
Once I'm setup it should be OK.
Posted: Wed Jul 20, 2005 2:18 am
by kidgoo
gwilsonmail wrote:They replied
"There is no other solution for this, than to let us know, and we will fix the ownership of files."
This may be an issue with virtual hosting, which is so common these days and at the price-point for blogging.
i have to admit at $2.95/mth for one domain and $4.95 for ~10 domains it's a good deal.
Once I'm setup it should be OK.
It's not a good deal if they don't have it properly configured
I ran into loads of problems with a shared host provider a few years back...you gotta watch those super cheap ones!
In another thread I mentioned suphp, which is an apache module that lets php applications run with user privleges...No one replied if it's been tried for s9y, but I would imagine it works. From an administrative point of view, this would be a much more reasonable solution than to have users email each time they need permissions reset. You may want to mention this to your provider to see if they would install it...
Brett
Posted: Wed Jul 20, 2005 4:41 am
by gwilsonmail
Do they have it misconfigured or are they being ultraprotective of their server?
I ran into the same issue (wrong ownership) last week and I had no idea that it was related to the install. They said it "happens sometimes" and that they'd fix it if it ever happened again.
Thinking about it - how did i ever get s9y to work in the first place? Then it struck me that i had installed and had it working locally on my pc. Then i ftp'd the files to the server and changed the params in the config file.
That seems to be a reasonable work around - install somewhere else, then transfer all the files. That way you get the ownership and permissions you want without involving the ISP.
Posted: Wed Jul 20, 2005 5:49 am
by kidgoo
I shouldn't have said that they don't have it configured properly...that's a bit of my bad experiences speaking...
What you are experiencing is very common, but there are steps the provider could take to help avoid it. Basically the problem is that apache, the httpd server, is running as user that isn't you. It will generally write files as:
-rw------- 1 apache apache 590 Jul 1 19:45 serendipity_config_local.inc.php*
This means that only the user apache has any read or write access to this file. The solution Garvin gave you would usually have worked, but they apparently have tighter security. As suphp fixes this problem, I'm at a loss to explain why they haven't used it...though I admit I've never had a reason to use it on my server, so it could be horrible for all I know...
The problem with the work around you describe is that s9y generally won't have write access to the files unless you are able to chown or chmod them. The permissions errors you spoke of earlier may be the result of this...
I understand the desire for a cheap host...I've been there myself...but sometimes it's worth it to spend a few extra dollars for shell access and maybe even a VPS/VM/VDS.
I personally use unixshell.com, and they've been great. I think the cheapest they have is like $7 or $8, but full root access...
Brett
Posted: Wed Jul 20, 2005 7:17 am
by gwilsonmail
Thanks Brett.
It's all becoming a lot clearer!
I can't chown.
But i can chmod via PLESK or an FTP client. So as long as i get the ownership correct I should be able to sort things out.
I just discovered that they didn't change the ownership of .htaccess!
Tomorrow is another day.
thanks for your assistance. much appreciated