0

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 :)

1 Answer 1

2

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.

2
  • 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, 2013 at 22:53
  • I'm sorry about the messy comment, but the comments doesn't have line breaks!
    – sikas
    Jan 24, 2013 at 22:54

Not the answer you're looking for? Browse other questions tagged .