Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 29th April 2006, 05:49 PM
lozd Offline
Registered User
 
Join Date: Mar 2006
Location: Melbourne, Australia
Posts: 14
Apache docroot file permissions, owner & group

I am running apache under fc5.

Can anybody tell me what should be the permissions, owner and group of files and folders under /var/www/html.
__________________
:eek:
Reply With Quote
  #2  
Old 29th April 2006, 06:01 PM
ccrvic Offline
Registered User
 
Join Date: Apr 2006
Posts: 1,092
Quote:
Originally Posted by lozd
Can anybody tell me what should be the permissions, owner and group of files and folders under /var/www/html.
That's pretty much down to how you want to use it.

All that's really necessary is that it must be *readable* by apache, and writable by whomever is going to be putting stuff up there...

Vic.
Reply With Quote
  #3  
Old 29th April 2006, 06:20 PM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 86
Posts: 1,657
On a fresh install the default owner is root. It is a good idea to create either a user or group that has access to the web-root and to set a group bit to keep ownerships in check, but if you are the only user, the defaults should be OK. "Readable" by apache means that "others" can read the files, not necessarily own them. The octal permission is usually 755 or 775, depending on how you need it, but content generally shouldn't be "world" writable.

http://forums.fedoraforum.org/forum/...d.php?t=105980
__________________
Ziggy
Reply With Quote
  #4  
Old 29th April 2006, 06:25 PM
ccrvic Offline
Registered User
 
Join Date: Apr 2006
Posts: 1,092
Quote:
Originally Posted by Zigzagcom
"Readable" by apache means that "others" can read the files
It could do. Or you could have apache as the group owner. It all depends on how you want to do it...

Quote:
Originally Posted by Zigzagcom
content generally shouldn't be "world" writable.
Content should *never* be world-writable.

There is always a way to set up your permissions so that everyone who needs write access will get it - without allowing everyone to write all over your sensitive content...

Vic.

Last edited by ccrvic; 30th April 2006 at 10:26 AM. Reason: Type in quoting syntax
Reply With Quote
  #5  
Old 30th April 2006, 02:22 AM
Zigzagcom Offline
Registered User
 
Join Date: Feb 2005
Location: CALIFORNIA, yeah
Age: 86
Posts: 1,657
Point taken. I ran into an web-app called "loudblog" that does instruct to make a couple of directories world writable (for uploading audio content), but then maybe there is a way to use group permissions instead.
__________________
Ziggy
Reply With Quote
  #6  
Old 30th April 2006, 10:38 AM
ccrvic Offline
Registered User
 
Join Date: Apr 2006
Posts: 1,092
Quote:
Originally Posted by Zigzagcom
I ran into an web-app called "loudblog" that does instruct to make a couple of directories world writable (for uploading audio content)
There are a number of applications that make the same recommendation. It's just sheer laziness on the part of the developers - it means they don't have to think about security. Unfortunately, it opens up the server to attack (particularly if you allow overrides - think .htaccess injection and ExecCGI directives).

It's a large risk, and it's *totally* unnecessary.

Take your example above - a web-based application that allows users to upload files. Now because these files are passed to Apache via some sort of web page, the user that actually does the writes to disk will always be - apache. It doesn't matter who is sending the files, it is apache that does the writes. Thus only apache needs write access to these areas; the recommendation to make the world-writable just doesn't stand up to scrutiny.

Quote:
Originally Posted by Zigzagcom
but then maybe there is a way to use group permissions instead.
There is *always* a way to set up the permissions to do what you want without using world-writable. The only possible exception to that is /tmp, and even then, I've seen 775 on that in certain (slightly strange) circumstances.

Vic.
Reply With Quote
Reply

Tags
apache, docroot, file, group, owner, permissions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Owner and Group greasyfingers Using Fedora 3 30th January 2007 09:51 PM
How to restore default owner and group? mikezang Using Fedora 1 26th December 2005 01:13 PM
apache fc3 questions: starting apache & file permissions mexicoshanty Servers & Networking 2 16th June 2005 07:56 AM
Changing file Owner/Group in bash yerfspd Using Fedora 5 12th May 2005 10:20 PM


Current GMT-time: 23:19 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat