Support»Chroot Directory

Setting the Chroot Directory

By default, the topmost directory of your Qdig gallery tree is the present working directory when the script is run. Qdig includes a setting that allows you to set the topmost directory of your gallery to a directory "below" the current working directory (that is, change its root directory).

This setting is especially useful if you are embedding a gallery within another web page. It also combines well with external Qdig settings (available starting with Qdig 1.2.6) because you can easily create tiny wrapper scripts that isolate portions of your gallery.

Example

Lets say your web directory looks like this:

 
./
|-- qdig.php
`-- gallery
    |-- Cats
    |   |-- GoldieCat.jpg
    |   `-- MaxCat-1600.jpg
    `-- Dogs
        |-- Haley-550s.jpg
        |-- Lilly.jpg
        `-- MulliganPortrait.jpg

You can use $chroot_dir to set to topmost directory to

The scripts for all three of these galleries are exactly the same except each has a different root directory. All you need to do is set

  $chroot_dir = 'gallery/';

or

  $chroot_dir = 'gallery/Dogs/';

or

  $chroot_dir = 'gallery/Cats/';

to do this.