Solved

user running webser as

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

        /usr/local/roads/logs
        /usr/local/roads/guts
        /usr/local/roads/source
with apache on linux
0
Comment
Question by:mafiq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 15

Expert Comment

by:samri
ID: 7184475
mafiq,

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.

http://httpd.apache.org/docs/suexec.html

cheers.
0
 

Author Comment

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

Help pliz
0
 
LVL 15

Expert Comment

by:samri
ID: 7184634
Mafiq,

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;

       /usr/local/roads/logs
       /usr/local/roads/guts
       /usr/local/roads/source

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.

Cheers.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Accepted Solution

by:
samri earned 23 total points
ID: 7184816
mafiq,

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.

0
 
LVL 15

Expert Comment

by:periwinkle
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.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

periwinkle
EE Cleanup Volunteer
0

Featured Post

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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