Server setup, /cache writable at chmod 755
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexServer Chat
Author Message
warden
Silver Supporter


Joined: Dec 16, 2004
Posts: 196
Location: North Carolina

PostPost subject: Server setup, /cache writable at chmod 755
Posted: Sun Nov 01, 2009 2:49 pm
Reply with quote

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
View user's profile Visit poster's website
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5668
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Server setup, /cache writable at chmod 755
Posted: Sun Nov 01, 2009 10:24 pm
Reply with quote

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
View user's profile Visit poster's website Yahoo Messenger
warden
Silver Supporter


Joined: Dec 16, 2004
Posts: 196
Location: North Carolina

PostPost subject: Re: Server setup, /cache writable at chmod 755
Posted: Mon Nov 02, 2009 10:06 am
Reply with quote

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
View user's profile Visit poster's website
DJ Maze
Developer


Joined: Apr 19, 2004
Posts: 5668
Location: http://tinyurl.com/5z8dmv

PostPost subject: Re: Server setup, /cache writable at chmod 755
Posted: Mon Nov 02, 2009 4:38 pm
Reply with quote

In the admin serverinfo page you see the owner and process owner Wink

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
View user's profile Visit poster's website Yahoo Messenger
warden
Silver Supporter


Joined: Dec 16, 2004
Posts: 196
Location: North Carolina

PostPost subject: Re: Server setup, /cache writable at chmod 755
Posted: Thu Nov 05, 2009 3:29 am
Reply with quote

Thanks for the information DJ, and your time.
_________________


warden's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexServer Chat All times are GMT
Page 1 of 1


Jump to:  
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

stopsoftwarepatents.eu petition banner
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.4302 seconds with 19 DB Queries in 0.0491 seconds
Memory Usage: 2.89 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy