8, September 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 607 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 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 : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 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
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 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 : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 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
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 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 : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 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
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 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 : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 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
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6309
38674 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 : Is your website is down? Know before your visitors do!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 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
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
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?
Sep 08, 2008, 06:57:28 AM





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: 36.302
Total Topics: 7.479
Total Members: 3.907
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: phpprofit

20 Guests, 4 Users online :

6 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.