Solved

Win XP Apache Permissions (outside of htdocs)

Posted on 2004-08-18
1
658 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
[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
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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Upload using Uploadify 4 126
file path 14 75
Apache timeout remote connection if not port 80 10 104
PHP: Insert Data into MySQL 5 68
As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
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). #…

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