Solved

Win XP Apache Permissions (outside of htdocs)

Posted on 2004-08-18
1
653 Views
Last Modified: 2011-04-14
Not sure if this is a Apache question or a php question.

I have Win XP Pro, with Apache and PHP 5

I have my doc root folder standard,
it is C:/Apache/htdocs

The problem is, I don't want scripts I write in those folders to access outside that folder.

for instance, I can use ../../ and get to c:/ (this of course in php scripting)
ex. fopen("../../boot.ini","r")   this would be opening c:/boot.ini

How can I stop this?  how can I make the user (well the person who has access to writing scripts and html pages) see the document root as /htdocs or even just / ?
or just make them not have permissions below C:/Apache/htdocs

Thanks
0
Comment
Question by:ThaSmartUno
1 Comment
 
LVL 15

Accepted Solution

by:
samri earned 500 total points
ID: 11838485

I would think that you could configure your PHP to restrict the execution of PHP to certain document tree, and preventing them to traverse up the tree.  

At the OS level, you could fine your setting such that Apache would have a different User/Group, and restrict filesystem access to those that is allowed.  This should be fine.  I  haven't tried this, but in theory it should work.

Personally, I would prefer the 2nd options.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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