Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an apache server installed on Windows 7 .. I use it mainly for testing .. Now, I need to modify the settings of the apache to work as real servers. Below is the list I need to approach.

First: I have multiple Dynamic DNSes registered at dyndns.com .. I want each one to go to a specific folder .. I have managed to make ports go to different folder, but don't know how to make it with the dynamic DNS or Domain Names ..

Second thing, I usually use shell scripts to test security of the server, whenever I use the shell script, I can navigate to every directory on the server, even I can see other drives ..

How can I force the user to see not be able to navigate outside the folder specified?

EX: www folder exists at C:/wamp/www .. Inside it I have website1 and website2 .. If I upload the shell to website1, I can use it to get the files/folders in website2 .. How can I make the script think that folder website1 is the root folder and has nothing above it??

Last thing, on shared servers, I can access any website hosted with the Domain Name, also with the IP Address of the server followed by a forward slash and ~folder

EX: The server address is 1.2.3.4 ... When I go to http://www.website.com I can see the home page .. How can I make http://1.2.3.4/~website goes to the same directory as http://www.website.com

Apologies for the long question :)

share|improve this question

closed as off-topic by MDMarra, Katherine Villyard, Dave M, Rex, Falcon Momot Feb 18 at 10:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – MDMarra, Katherine Villyard, Dave M, Rex, Falcon Momot
If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

1 Answer

up vote 2 down vote accepted

First: I have multiple Dynamic DNSes registered at dyndns.com .. I want each one to go to a specific folder .. I have managed to make ports go to different folder, but don't know how to make it with the dynamic DNS or Domain Names ..

This is called "name based virtual hosting". The documentation for Apache 2.2 is here.

Second thing, I usually use shell scripts to test security of the server, whenever I use the shell script, I can navigate to every directory on the server, even I can see other drives ..

I suspect that the answer to the previous question will solve this one, since using virtual hosts will put the content for each site in a seperate DocumentRoot. Make sure that each site is not in a subdirectory of another host (such as the primary server DocumentRoot).

Last thing, on shared servers, I can access any website hosted with the Domain Name, also with the IP Address of the server followed by a forward slash and ~folder

Right...this goes to what I was saying about making sure that the content of each site is not located somewhere where it can be accessed by the main server. That is, if your httpd.conf has:

DocumentRoot c:\wamp\html

Then do not place the website1 and website2 directories in this directory.

share|improve this answer
    
First, Thanks on the reply. Second: I didn't quite understand this part "Make sure that each site is not in a subdirectory of another host (such as the primary server DocumentRoot). .. Also this one "Right...this goes to what I was saying about making sure that the content of each site is not located somewhere where it can be accessed by the main server. That is, if your httpd.conf has: DocumentRoot c:\wamp\html Then do not place the website1 and website2 directories in this directory." As I understand, there is the main WWW folder that contains everything for the server. –  sikas Jan 24 '13 at 22:53
    
I'm sorry about the messy comment, but the comments doesn't have line breaks! –  sikas Jan 24 '13 at 22:54
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.