dmi-gal Installation Instructions (short version) --------------------------------------------- cp dmi* /my/directory/with/images/and/or/movies/in/it/ cp -r template /my/directory/with/images/and/or/movies/in/it/ cp header.php.dist /my/directory/with/images/and/or/movies/in/it/header.php cp footer.php.dist /my/directory/with/images/and/or/movies/in/it/footer.php chown nobody /my/directory/with/images/and/or/movies/in/it/ chmod u+w /my/directory/with/images/and/or/movies/in/it/ ln -s /my/directory/with/images/and/or/movies/in/it/dmi.php \ /my/directory/with/images/and/or/movies/in/it/index.php If you don't have HOPP available in your PHP_INCLUDE_PATH or you are uncertain: Get HOPP Unpack HOPP somewhere cd /path/to/somewhere/hopp-0.x.y cp -r * /my/directory/with/images/and/or/movies/in/it/ mv dmi-conf.inc.php.dist dmi-conf.inc.php vi /my/directory/with/images/and/or/movies/in/it/dmi-conf.inc.php This short installation procedure has not meen tested so cross your fingers. dmi-gal Installation Instructions (long version) -------------------------------------------- 1. Get PHP working on your webserver. Make sure you have a .php file listed as one that should be used by default for a directory. For example on apache you should have something like: DirectoryIndex index.html index.php 2. Make sure you have ImageMagick installed. Try typing 'which convert' to see if it's found. If not you can get it from http://www.imagemagick.org. Most Linux and BSD distributions have it already. 3. If you want to use dmi for MPEG movies, you'll need to make sure you have the following installed: mpgtx (http://mpgtx.sourceforge.net) dumpmpeg (http://sourceforge.net/projects/dumpmpeg/) SDL (http://www.libsdl.org/) SMPEG (http://www.lokigames.com/development/smpeg.php3) 4. Make sure you have HOPP 0.7.6 or later available in cpur PHP_INCLUDE_PATH If you don't have HOPP you can get it fron http://www.h-o-p-p.org Unpack HOPP in a directory accesible to your web server Symlink hopp-0.x.y to hopp 5. Unpack dmi-gal in a directory accesible to your web server Symlink dmi-gal-1.x.y to dmi-gal 6. It's a good practice for security reasons to have an includes file in a different directory than your web pages. Create a directory for your gallery mkdir /my/gallery/dir Create ynside your gallery dir 3 subdirectories: html, include and pics mkdir /my/gallery/dir/html mkdir /my/gallery/dir/include mkdir /my/gallery/dir/pics Copy the dmi default templates to your gallery dir cp -r /directory/where/i/unpacked/dmi-gal/template /my/gallery/dir/ Set your DocumentRoot to the html directory In Apache it should look like: DocumentRoot /my/gallery/dir/html Add the include, HOPP and dmi-gal directories to your PHP_INCLUDE_PATH On Apache it should look like: php_value include_path .:/my/gallery/dir/include:/directory/where/i/unpacked/hopp:/directory/where/i/unpacked/dmi-gal 7. Create an alias for the pics directory in your web server config file In Apache it should look like: Alias /pics/ "/my/gallery/dir/pics/" If your web server does not provide aliases feature you can either symlink the pics dir to the html dir. ln -svf /my/gallery/dir/pics /my/gallery/dir/html/pics You can at your choice move the pics directory inside the html directory if you don't care about people browsing the pics directory directly. mv /my/gallery/dir/pics /my/gallery/dir/html/pics Note that the pics directory can contain text files with the pictures titles and the thumbnails subdirectories. 8. Create a hopp.conf.inc.php file in your gallery include directory The hopp.conf.inc.php should contain the following: You can copy the procided hopp.conf.inc.php.dist and edit it accordingly 9. Copy the provided dmi-conf.inc.php.dist to dmi-conf.inc.php cp /directory/where/i/unpacked/dmi-gal/dmi-conf.inc.php.dist /my/gallery/dir/include/dmi-conf.inc.php Edit the dmi-conf.inc.php to tweak any configuration options. 10. Symlink dmi-big.php, dmi-thumb.php and dmi.php to your html directory ln -s /directory/where/i/unpacked/dmi-gal/dmi-big.php /my/gallery/dir/html/ ln -s /directory/where/i/unpacked/dmi-gal/dmi-thumb.php /my/gallery/dir/html/ ln -s /directory/where/i/unpacked/dmi-gal/dmi.php /my/gallery/dir/html/ You can symlink dmi.php to index.php to make it your directory index ln -s /my/gallery/dir/html/dmi.php /my/gallery/dir/html/index.php 11. Create header.php and footer.php files in your html directory You can copy the provided header.php.dist and footer.php.dist files provided cp /directory/where/i/unpacked/dmi-gal/header.php.dist /my/gallery/dir/html/header.php cp /directory/where/i/unpacked/dmi-gal/footer.php.dist /my/gallery/dir/html/footer.php You can have whatever php code you need in your header and footer files. 12. Make either the pics directory writable by the webserver, or create a directory in it called "thumbs" and make that directory writable by the webserver. Example 1 (if you have root access): ------------------------------------ chgrp nobody /my/gallery/dir/pics/ chmod g+w /my/gallery/dir/pics/ Example 2 (if you don't have root access): ------------------------------------------ chmod a+w /my/gallery/dir/pics/ Example 3 (if you have root access and don't want to ever enable uploads): --------------------------------------------------------------------------- mkdir /my/gallery/dir/pics/thumbs chgrp nobody /my/gallery/dir/pics/thumbs chmod g+w /my/gallery/dir/pics/thumbs 13. Start adding pictures and movies to your pics directory You can create a text file with the picture's name and the extension .txt containing the picture's title or description 14. Try it out http://yourserver.tld/dmi.php If you symlinked dmi.php to index.php you can try the utl without dmi.php http://yourserver.tld/ 15. You can have multiple galleries using the same hppp and dmi-gal directories. If you are using virtual hosts follow steps 6 to 13 If you want the galleries as different subdirectories inside the same DocumentRoot you need to follow steps 9 to 13, but in this case you need to have a different dmi-conf.inc.php on each subdirectory where you have the symlinks to dmi*.php in order to specify the different pics dir (__DMI_PHOTO_DIR) for each gallery. You can have a dmi-conf.default.inc.php and just include it in your local dmi-conf.inc.php before overriding the __DMI_PHOTO_DIR. If you don't care people browsing your pics directory directly, an easier way is to set __DMI_PHOTO_DIR to ./pics and have the pics directory as a subdirectory of each gallery. This way you don't need to have a different dmi-conf.inc.php on each gallery. The hopp.conf.inc.php can also be set on a per-gallery basis, in this case changing the template dir, but this can also be done inside the dmi-conf.inc.php if you prepend the lines: if(!defined('__HOPP_PARAMS_TEMPLATE')) { define('__HOPP_PARAMS_TEMPLATE',1); define('__HOPP_TEMPLATE_DIR__','/var/pages/gallery/template/'); } 16. The configuration flexibility gives you freedom. Use it as you wish and don't complain. If you don't feel comfortable with all this complexity you should try the original DMI (http://tjw.org/dmi/) and don't complain about lack of features. Features have a complexity price and a performance price too.