|
Related YoLinux Tutorials:
°Web Site Configuration
°Web Tricks
°Web Site Password Protection
°Apache Redirect
°Internet Security
°Disc Quotas
°YoLinux Tutorials Index
|
| myPhotoGallery Installation: |
Prerequisites:
- It is assumed that Red Hat 7.1 is installed including the Apache web server and PERL.
- Install ImageMagick version 5.3.7 (ImageMagick Home)
- Download RPM's from: ftp://ftp.nluug.nl/pub/ImageMagick/linux/redhat-7.x/i386/
(They also have tar.gz files.)
- ImageMagick-5.3.7-1
- ImageMagick-devel-5.3.7-1
- ImageMagick-perl-5.3.7-1
- ImageMagick Installation:
rpm -Uvh --nodeps -ImageMagick-5.3.7-1.i386.rpm ImageMagick-perl-5.3.7-1.i386.rpm ImageMagick-devel-5.3.7-1.i386.rpm
[Potential Pitfall] The --nodeps flag fixes the dependancy on libbz2.so.1.0
Add link: ln -s /usr/lib/libbz2.so.1.0.0 /usr/lib/libbz2.so.1.0
[Potential Pitfall] The installation of C++ development libraries may cause dependancy failures. They can be removed:
rpm -e ImageMagick-c++-5.2.7-2 ImageMagick-c++-devel-5.2.7-2
- Install PERL modules:
# perl -MCPAN -e shell
cpan> install IO::String ... .. .
cpan> install Image::Info Image::Info is up to date. - I guess I was good to go on this one.
cpan> install Image::Magick - I did not need to do this as it was supplied by the RPM
cpan> exit
First time through it will ask a bunch of questions.
(Answer "no" to the first question for autoconfigure.)
Defaults were good for me. The only reason to manually configure this is if you are using a proxy.
It then asks for your location (i.e. North America) and country.
I entered a number for the first CPAN server but after that the actual URL was cut and pasted in whole.
If it fails, you must load the appropriate RPMs and retry using
"force install module-name"
Install myPhotoGallery:
- Prepare CGI directory:
cd /var/www/cgi-bin/ mkdir cgi-user1-photo - or pick a name which works for you.
chmod +rx cgi-user1-photo
- Unpack myPhotoGallery: tar xzf myphotogallery-2.6.tar.gz
- Relocate cgi and prepare cgi directory:
cd photo - Directory created by un-taring/un-zipping tar.gz file.
cp -R common.pl sitevariables.pl index.cgi news.html protected/ /var/www/cgi-bin/cgi-user1-photo
touch /var/www/cgi-bin/cgi-user1-photo/log.txt chmod ugo+w /var/www/cgi-bin/cgi-user1-photo/log.txt
- Relocate supporting image files:
cp -R site-images/ /home/user1/public_html/photos/
[Potential Pitfall]
The cgi must run under (switch user) the owners id or make
this directory
writable by group/user apache so that directories may be created and photos
uploaded via the web and the cgi admin page.
By default, the Red Hat 7.1 configuration has the apache web server running under the user id apache.
- Edit configuration files: (First cd /var/www/cgi-bin/cgi-user1-photo/)
- Set paths: sitevariables.pl
- Edit Greeting: news.html
Sample:
<H1>Our family photo gallery on the web.</H1> <P> <H2>READ THESE INSTRUCTIONS BEFORE UPLOADING PHOTOS!!!!</H2>
<B>View Photos:</B> Select an album (on the left) and enjoy, view and add comments to pictures as you choose.
<B>Upload Photos:</B> To add photos to an album or generate a album/folder for a new event or individual family group, go to the photo gallery management page and select an album to manage from the bottom of the page. Note select the album folder and NOT the "delete album" button! Also note that you need to choose an album as a destination before uploading photos.
<B>Tips:</B> <UL> <LI>If using a blank within a file name, please use an underscore "_" instead. <LI>Don't use the character "&" in a file or folder name. </UL> <LI>Warning: Uploading a file of zero size causes the entire page to go blank when viewed!!!</UL>
Using myPhotoGallery:
- Viewing: http://your-domain/cgi-bin/cgi-user1-photo/index.cgi
- Configuration Management: http://your-domain/cgi-bin/cgi-user1-photo/protected/manage.cgi
[Potential Pitfall] A corrupted or blank
JPEG image
file will cause a unique error. When viewing an album, the entire page will be
blank. Remove the image file or rename with a "." as a prefix to make it a
hidden file and all will work again.
[Potential Pitfall] Do NOT upload an image
file with blanks in the name because it will mess up the generation of the thumbnail images. Use and underscore "_" instead.
It is not something that UNIX users would typically do but the MS/Windows users
seem to do this as a matter of habit.
[Potential Pitfall] Do not use the character "&" in a file or folder name.
[Potential Pitfall] Upgrade from Red
Hat 7.1 to 7.3 breaks the Photo Album due to bugs in Image Magick. To
fix this I had to reinstall the old version by performing the following
steps:
- rpm -e ImageMagick ImageMagick-perl ImageMagick-devel xfig
- ln -s /usr/lib/libbz2.so.1.0.2 /usr/lib/libbz2.so.1.0
- rpm -ivh --nodeps ImageMagick-5.3.7-1.i386.rpm ImageMagick-devel-5.3.7-1.i386.rpm ImageMagick-perl-5.3.7-1.i386.rpm
| Using KDE 3.1 File Manager (kfm) to generate a static photogallary: |
A simple alternative to the MyPhotoGallery solution described above:
The KDE file manager has the ability to generate a web page (html) displaying
thumbnails of photos which when selected will display the full photo.
This is a simple but static (no upload or interactivity) solution to a photogallery.
This requires ImageMagick.
Place all photos to be displayed on the web page in a single directory.
Launch the KDE file manager:
- /usr/bin/kfmclient exec ./
Where "./" is the current directory or the directory path of the
photos.
- /usr/bin/konqueror
Browse file system with browser: file:/
Use the KDE file manager to go to that directory and press "ctrl-I" to
generate. (Or from the task bar select: "Tools" + "Createimage gallery")
The result is the generation of thumbnail images of all photos and a web page
(html) to display all the thumbnail images with hyperlinks to the actual photos.
The KDE file transfer capabilities may be used to upload this to the web server.
(fish://www.host.com/path uses ssh for file transfer).
|