Solved

user running webser as

Posted on 2002-07-26
7
160 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Redirect all pages to one specific page 1 108
phpPgAdmin problem 14 84
PHP Apache application gives "Forbidden" message 5 44
Setting up a WAMP server... 7 55
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 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

17 Experts available now in Live!

Get 1:1 Help Now