Server setup, /cache writable at chmod 755
| Author |
Message |
warden


Joined: Dec 16, 2004 Posts: 196 Location: North Carolina
|
Post subject: Server setup, /cache writable at chmod 755 Posted: Sun Nov 01, 2009 2:49 pm |
|
This is a topic that I have been hesitant to start for some time now. Technically, this may not apply to DF but I know that there are some people here that know a lot more about Apache than others and I ask for your help since Dragonfly is involved.
This deals with Apache configuration and making the Dragonfly /cache folder writable at chmod 755 instead of 777.
I am building a home web server to host an initial DF site. Over time I will move others there, but for now, I only want to get the first one working correctly. The server Administrator is myself, with root access of course.
I have used commercial servers that worked fine with the cache folder readable and writable at chmod 755 with no errors showing on the DF page. But with the setup that I now have on my home server, it will only read/write correctly to the cache folder at chmod 777, which is more of a security concern than chmod 755.
How to I configure the Apache server to allow for DF to use the cache folder correctly at chmod 755 instead of 777? Or, should I not be concerned about it?
I am using webmin as a gui administration interface, if that helps, with Linux kernel 2.6, Apache 2.2.x, mysql 5.0.x, php 5.x. I currently have the file and folder creation octel set at 022 which does create files and folders at a chmod 755 default.
I could ask this on an apache forum board, but I don't know if I would ask it correctly, so I will ask here with the DF cache folder example. Thanks for any assistance.
_________________

warden's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
 |
|
| Back to top |
|
 |
DJ Maze


Joined: Apr 19, 2004 Posts: 5668 Location: http://tinyurl.com/5z8dmv
|
Post subject: Re: Server setup, /cache writable at chmod 755 Posted: Sun Nov 01, 2009 10:24 pm |
|
There are several things you should know about GNU/Linux.
What is 0755?
7 = owner (read + write + execute)
5 = group (read + execute)
5 = other (read + execute)
Who is the owner?
Well that depends on "who" created the directory.
Was it "apache", "root" or anyone else?
By default when you create a directory thru FTP the owner of the directory is the name of the person you used for login on the FTP
Who is the owner of the PHP process?
That depends how PHP is called. If you use PHP as Apache module it could be "apache" or "www-data".
When running PHP in FastCGI mode with chroot (change root) it can be anyone.
So, to properly configure your server you need Apache + Chroot + FastCGI + PHP and configure a "webuser" that owns all files and directories.
That way PHP is run by "webuser" and has write access to the directory of "webuser".
To further protect your system 100% make all files 0222 (read-only) and any other directory 0555.
That way there is no "normal" crack script that can modify any file.
DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS |
|
| Back to top |
|
 |
warden


Joined: Dec 16, 2004 Posts: 196 Location: North Carolina
|
Post subject: Re: Server setup, /cache writable at chmod 755 Posted: Mon Nov 02, 2009 10:06 am |
|
Thank you for this explanation DJ. It helps me to understand more about this.
_________________

warden's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
 |
|
| Back to top |
|
 |
DJ Maze


Joined: Apr 19, 2004 Posts: 5668 Location: http://tinyurl.com/5z8dmv
|
Post subject: Re: Server setup, /cache writable at chmod 755 Posted: Mon Nov 02, 2009 4:38 pm |
|
In the admin serverinfo page you see the owner and process owner
DJ Maze's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Fedora 12 / 2.2.15 / 5.1.47 / 5.3.3 / CVS |
|
| Back to top |
|
 |
warden


Joined: Dec 16, 2004 Posts: 196 Location: North Carolina
|
Post subject: Re: Server setup, /cache writable at chmod 755 Posted: Thu Nov 05, 2009 3:29 am |
|
Thanks for the information DJ, and your time.
_________________

warden's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
 |
|
| Back to top |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|

|
User Info ![Show/hide content [x]](themes/dragonfly/images/minus.png)
 Welcome Anonymous
Last CVS commits ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Languages ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Community ![Show/hide content [x]](themes/dragonfly/images/minus.png)
 Support for DragonflyCMS in a other languages:
• Deutsch
• Español
X-links ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Preview theme ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.
|