Solved

Win XP Apache Permissions (outside of htdocs)

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

15 Experts available now in Live!

Get 1:1 Help Now