Solved

user running webser as

Posted on 2002-07-26
7
162 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
  • 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …

828 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