12, May 2008

write permissions for Apache? - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web hosting talk  >  Configuring your server  >  Apache web server
Topic: write permissions for Apache?
« previous next »
Pages: [1] Print

Author Topic: write permissions for Apache?  (Read 507 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6236
38242 credits
Members referred : 374


It's time to use PHP5!


« on: Jun 11, 2007, 03:28:07 PM »

Hi,

just noticed that my server's apache doesn't have write permissions to folders inside the public_html folder.

is it safe change the permission for Apache and if yes how?

Thanks


Last blog : Website layout dimensions today
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7822
39867 credits
Members referred : 3



« Reply #1 on: Jun 11, 2007, 08:18:36 PM »

I don't know which is the common technique to that, but I personally give ownership to the whole www directory to the account nobody:nogroup

This way both Apache and the cgi services can write with no problems.

Trial and Error my two best teachers Cool
Promote your blog for free.... Visit through proxy

Last blog : Keep it Legal - Tims guide to legal notices
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6236
38242 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Jun 11, 2007, 08:57:22 PM »

is there a way to automate this?


Last blog : Website layout dimensions today
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7822
39867 credits
Members referred : 3



« Reply #3 on: Jun 11, 2007, 09:11:22 PM »

First you need to run this command in console :

Code:
chown nobody:nogroup -R /path/to/htdocs

Then you can use this directive in httpd.conf:

Code:
User nobody
Group nogroup

Trial and Error my two best teachers Cool
Promote your blog for free.... Visit through proxy

Last blog : Keep it Legal - Tims guide to legal notices
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6236
38242 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Jun 11, 2007, 11:17:32 PM »

I use this config in my account template?

User nobody
Group nogroup


Last blog : Website layout dimensions today
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7822
39867 credits
Members referred : 3



« Reply #5 on: Jun 11, 2007, 11:53:24 PM »

I am not sure what you mean "account template" but this is the rule that should be in the httpd.conf file, and I don't think it is a rule that can be applied through .htaccess or something else.

Trial and Error my two best teachers Cool
Promote your blog for free.... Visit through proxy

Last blog : Keep it Legal - Tims guide to legal notices
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6236
38242 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Jun 12, 2007, 12:09:41 AM »

I am not sure what you mean "account template" but this is the rule that should be in the httpd.conf file, and I don't think it is a rule that can be applied through .htaccess or something else.

OK I understand, this setting is for all hosting accounts, is there a place I need to add this setting?


Last blog : Website layout dimensions today
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7822
39867 credits
Members referred : 3



« Reply #7 on: Jun 12, 2007, 09:25:52 AM »

It is in the "section 2" of the configuration file. BTW now I see it again the correct way to use it is like this :

Code:
<IfModule !mpm_winnt.c>
<IfModule !mpm_netware.c>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch. 
#
# User/Group: The name (or #number) of the user/group to run httpd as.
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  . On HPUX you may not be able to use shared memory as nobody, and the
#    suggested workaround is to create a user www and use that user.
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 60000;
#  don't use Group #-1 on these systems!
#
User nobody
Group nogroup
</IfModule>
</IfModule>

Trial and Error my two best teachers Cool
Promote your blog for free.... Visit through proxy

Last blog : Keep it Legal - Tims guide to legal notices
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6236
38242 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Jun 12, 2007, 09:30:58 AM »

Sad I have a modified http conf file (Directadmin), but I guess I can add the whole rule...


Last blog : Website layout dimensions today
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7822
39867 credits
Members referred : 3



« Reply #9 on: Jun 12, 2007, 09:33:08 AM »

Of course you can Wink

Be sure to restart apache then Smiley

Trial and Error my two best teachers Cool
Promote your blog for free.... Visit through proxy

Last blog : Keep it Legal - Tims guide to legal notices
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6784
Tags : apache Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web hosting talk  >  Configuring your server  >  Apache web server
Topic: write permissions for Apache?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 12, 2008, 12:48:59 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 34.925
Total Topics: 7.262
Total Members: 3.477
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: lalita

16 Guests, 4 Users online :

8 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.