473,383 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Apache/PHP different uid, gid?



As my little attempt at security, i have an apache server running under
a "web" group... That way, any php/html/directories i don't want any
one to see on the server, but that i would like to publish on the web
can just be given permissions of 770 or 660. Also, any one authorized
to change the scripts/html can also be in the "web" group. Is this a
good idea?

However.. One thing i noticed is that when i have scripts in 2
different directories say /projects/abc/dir1 and /projects/abc/dir2, and
one has to include another, PHP does not have permission to get in the
other directory unless i make it 776 (giving people not in the group
access to the directory).

When the directory is 770, i get a "failed to open stream: Permission"
error from PHP. I would think that since Apache runs under a certain
uid and gid which has access to the direcory, then php would run under
the same uid and gid, and therefore have access to the directory.
What's the problem? How do I fix it?

-d

Jul 17 '05 #1
1 2457
It should run as the same UID if it's running as a module... are you running
the module, or the CGI version? If you're running the CGI version, try
chowning it and chmodding it to set the "set user ID" and "set group ID"
properties.

Doug wrote:
As my little attempt at security, i have an apache server running
under a "web" group... That way, any php/html/directories i don't
want any one to see on the server, but that i would like to publish
on the web can just be given permissions of 770 or 660. Also, any
one authorized to change the scripts/html can also be in the "web"
group. Is this a good idea?

However.. One thing i noticed is that when i have scripts in 2
different directories say /projects/abc/dir1 and /projects/abc/dir2,
and one has to include another, PHP does not have permission to get
in the other directory unless i make it 776 (giving people not in the
group access to the directory).

When the directory is 770, i get a "failed to open stream: Permission"
error from PHP. I would think that since Apache runs under a certain
uid and gid which has access to the direcory, then php would run under
the same uid and gid, and therefore have access to the directory.
What's the problem? How do I fix it?

-d

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alex | last post by:
I'm running Apache 2.0.47, PHP 4.3.3 on RedHat 9.0 on a new server. I have a series of pages that let's say pages 1 -> 3 are non-ssl and 4-8 are SSL but the URL domain is different (shared SSL)....
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
7
by: Lad | last post by:
How can I set up Apache web server to use Python for CGI processing( for file *.py). Thanks for help Lad
56
by: Anonymous, quoting Philip Ronan | last post by:
Subject: Warning: robots.txt unreliable in Apache servers From: Philip Ronan <invalid@invalid.invalid> Newsgroups: alt.internet.search-engines Message-ID: <BF89BF33.39FDF%invalid@invalid.invalid>...
9
by: Matt Helm | last post by:
I am starting the design phase of a large project (ERP) where the backend will mostly be Python (or Ruby) providing web services. In this type of usage, is there any benenfit to running under...
8
by: lawrence k | last post by:
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying to install PHP 5.1.4. I can not get the ./configure command to work. I keep getting this error: configure: error: Invalid...
5
by: writeson | last post by:
Hi all, I'm wondering if anyone has tried a scenario that I'm thinking of. At my job we've got a web based product provided by Apache running PHP that accesses MySQL. This web application is...
5
by: m.banaouas | last post by:
Hi, bonjour, witch versions are suitable to use for apache & mod_python ? Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent versions) without facing any known major...
18
by: rfhurley | last post by:
How do I run a .php program? (I'm starting with the "hello world" script)
6
by: josequinonesii | last post by:
I've searched, I've read, I've tested and re-read numerous post but to no avail yet... Quite simply, the settings I've applied to my httpd.conf, httpd-vhost.conf and my hosts files simply does not...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.