$OpenBSD: README,v 1.2 2011/06/02 13:41:41 ajacoutot Exp $

+-----------------------------------------------------------------------
| Running p5-Apache-Gallery-1.0RC3p2 on OpenBSD
+-----------------------------------------------------------------------

In order to make A::G operate in a chrooted environment, it is
necessary to copy all of the relevant libraries and perl modules
that it employs into /var/www.

First, create the basic directory structure:

$ cd /var/www
# mkdir -p tmp usr
# chown www:www tmp	(needs to be writeable for the www user)

$ cd /var/www/
# mkdir -p ./usr/local/lib

$ cd /var/www/usr
# mkdir -p libdata/perl5 libexec {.,X11R6}/lib

Next, the run-time link-editor:

$ cd /var/www/usr/libexec
# cp -p /usr/libexec/ld.so .

Next, the required shared libraries:

$ cd /var/www/usr/lib
# cp -p /usr/lib/lib{c,m,z,util,perl}.so* .

$ cd /var/www/usr/local/lib
# cp -p /usr/local/lib/lib{jpeg,png,bz2,tiff,tiffxx,gif,Imlib2,ltdl,id3tag}.so* .
# mkdir -p imlib2/{loaders,filters}
# cp -pR /usr/local/lib/imlib2/loaders/*.so imlib2/loaders
# cp -pR /usr/local/lib/imlib2/filters/*.so imlib2/filters

$ cd /var/www/usr/X11R6/lib
# cp -p /usr/X11R6/lib/lib{Xext,freetype,X11,Xau,Xdmcp,xcb,pthread-stubs}.so.* .

Next, the Perl base:

$ cd /var/www/usr/libdata
# cp -pR /usr/libdata/perl5 .

Next, the A::G images and templates:

$ cd /var/www/usr/local
# mkdir -p share libdata/perl5/site_perl/`machine`-openbsd
# cp -pR /usr/local/share/Apache-Gallery share

Next, the non-base Perl stuff:

$ cd /var/www/usr/local/libdata/perl5/site_perl/
# mkdir -p {,`machine`-openbsd/{,auto/}}Apache
# cp -p /usr/local/libdata/perl5/site_perl/Apache/Gallery.pm Apache
# cp -pR /usr/local/libdata/perl5/site_perl/`machine`-openbsd/Apache* \
	`machine`-openbsd
# cp -pR /usr/local/libdata/perl5/site_perl/`machine`-openbsd/auto/Apache \
	`machine`-openbsd/auto
# cp -p /usr/local/libdata/perl5/site_perl/`machine`-openbsd/mod_perl*.pm \
	`machine`-openbsd

# mkdir -p {,`machine`-openbsd/}{,auto/}Image
# cp -pR /usr/local/libdata/perl5/site_perl/Image .
# cp -pR /usr/local/libdata/perl5/site_perl/auto/Image/Size auto/Image
# cp -pR /usr/local/libdata/perl5/site_perl/`machine`-openbsd/Image* \
	`machine`-openbsd
# cp -pR /usr/local/libdata/perl5/site_perl/`machine`-openbsd/auto/Image \
	`machine`-openbsd/auto

# mkdir -p Text URI IO
# cp -pR /usr/local/libdata/perl5/site_perl/Text/Template* Text
# cp -pR /usr/local/libdata/perl5/site_perl/IO/String* String
# cp -pR /usr/local/libdata/perl5/site_perl/URI* .


Setting up httpd
================
<VirtualHost *>
	ServerAdmin webmaster@host.some_domain.com
	DocumentRoot /var/www/htdocs
	ErrorLog    logs/gallery-error
	CustomLog   logs/gallery-access combined
	ServerName  gallery.site.tld
	Alias /icons/gallery/ "/usr/local/share/Apache-Gallery/icons/"
	Alias /gallery.css "/usr/local/share/Apache-Gallery/templates/new/gallery.css"
	# This is necessary.
	Options -Indexes
	PerlSetVar  GalleryCacheDir '/tmp/'
	PerlSetVar  GalleryTemplateDir '/usr/local/share/Apache-Gallery/templates/new/'
	PerlSetVar  GalleryInfo 'Picture Taken => DateTimeOriginal, Flash => Flash'
	PerlSetVar  GallerySizes '640 1024'
	PerlSetVar GalleryThumbnailSize '100x75'

	# Note that you will want to change this.
	PerlSetVar GalleryCopyrightImage '/usr/local/share/Apache-Gallery/icons/c.png'

	<Directory /usr/local/share/Apache-Gallery>
		order allow,deny
		allow from all
	</Directory>

	<Location />
		SetHandler perl-script
		PerlHandler Apache::Gallery
	</Location>

</VirtualHost>

