user running webser as

Posted on 2002-07-26
Last Modified: 2011-09-20
How do I make sure that the user that my Web server is running as is able to write

with apache on linux
Question by:mafiq
  • 3
  • 2
LVL 15

Expert Comment

ID: 7184475

make sure the userid the webserver is running (apache on linux, or nobody on other platform, or check the config file for User and Group directive), and make sure the respective user/group has write permision to these directories.

Another approach is to have apache to run with the same userid/group to those that has write access to the directories mentioned.

Another is to chmod 777 to the directories(haha... this is a BIG way too BIG security hole), but it should work.

Another approach is to look at SuExec feature.  Take a look at Apache docs site on some SuExec documentations.  It's pretty stratighforward, and quite extensive.


Author Comment

ID: 7184515
I have tried to check in the httpd.conf file but could not figure out what changes to make

Help pliz
LVL 15

Expert Comment

ID: 7184634

check the permission on those directories you wish the webserver could write to

In /usr/local/roads directory, do a "ls -l", and post the detail lines for these directories;


And in you httpd.conf (apache config file), look for the line that says "User" and "Group" keyword.  By default it should be "User apache", and "Group apache" with no quote (").

Btw;  What exactly you desired when you mentioned "is able to write".  Do you mean, get the CGI to write to some file?  Or in a bigger picture, what do you want to do?  Maybe we could assist with direct solution, or alternate solution could be offerred.

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline


Author Comment

ID: 7184647
CGI programs shld write to files in the directories I supplied.
LVL 15

Accepted Solution

samri earned 23 total points
ID: 7184816

A quick approach would be changing the group ownership of the directories to the same of apache group id,

# chgrp -R apache /usr/local/road/logs

This will change group ownership of ALL files in the directory to apache group.

and do a

# chmod g+w /usr/local/road/logs

(repeat the same for other dirs).  This would give write access

If you know that the server would be writing to a specific file, just change group/permission for that specific file.

LVL 15

Expert Comment

ID: 9691115
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area with the following recommendation for this question:

Answered by Samri

Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now