Closed Thread Icon

Topic awaiting preservation: apache: setting / to map to document root? Pages that link to <a href="https://ozoneasylum.com/backlink?for=27857" title="Pages that link to Topic awaiting preservation: apache: setting / to map to document root?" rel="nofollow" >Topic awaiting preservation: apache: setting / to map to document root?\

 
Author Thread
chex
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Apr 2006

posted posted 04-28-2006 18:33

I can't figure out how to enable the option that maps a prefix / in a url to map to document root, ie:

foo.html -> /webroot/foo.html (relative to current directory: /webroot)
/images/foo.png -> /webroot/images/foo.png (even though it's included from /webroot/foo/bar/fubar/foo2 )

Is it a custom rewrite, or a httpd.conf directive?

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 04-29-2006 07:50

Setting, maybe not, but you could start apache (if this is a single-site private server) with a custom script that also runs 'chroot /webroot/'

chroot is the *nix command that changes the apparent root directory for the current user to whever you specify. There's even better ways to do it, but I can't remember them off the top of my head.


Justice 4 Pat Richard

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 04-30-2006 17:52

what version of Apache are you running? The setting in Apache 2 is located a little different than in the older versions.

In the first version of Apache, the setting can be made in httpd.conf. There is a documentwebroot setting there that you can set to anything you want. I have a linux server at work that is set to the home directory so I can just ftp to it. It defaults to /var/www/htdocs which is only accesible to root. Can't FTP to that

In Apache2 there is a directory.conf file (I think that's what it's called) that you can set to whatever you want.

Check this out for that.

However, are you talking about virtual hosts? Where you can have a certain domain pointing to a specific directory? If so, this might help. I don't run any outside servers so I can't really help with that

Later,

C:\

« BackwardsOnwards »

Show Forum Drop Down Menu