Installation
============

1. Install MySQL. Tested on: 3.23.29a-gamma, 4.x OK.
	[fink install mysql]

2. Install Apache with mod_perl. Tested on: apache 1.3.14 with mod_perl
1.25. Apache 2.x should be OK.

3. Install Perl 5.6.1. Anything less than 6 should be OK?

4. Install Perl modules:
	- Data::ShowTable [fink install data-showtable-pm]
	- DBI (Tested with: v1.14) [fink install dbi-pm581]
	- Msql-Mysql Module (Tested with: v1.2215) [fink install dbd-mysql-pm581]
	This one can be tricky. It requires access to .h and library files
	from MySQL. I install MySQL from source first, but some installs of
	MySQL don't put the lib and include dirs where this module expects.
	The answer to the first question is that you only need MySQL
	support.

	Under Red Hat's GNU/Linux distribution, the zlib-devel RPM should be
	installed before you install this module.
	
	I think that this is actually the DBD::MySQL module. Oh wait, here
	it is: Bundle::DBD::mysql in CPAN (case-sensitive, argh!). Need to
	install using cpan command as root. May need to create
	/Library/Perl/5.8.6/darwin-thread-multi-2level first, as it didn't
	exist previously.	
	
	- MIME::Base64 (Tested with: v2.11) [fink install mime-base64-pm581]
	- Unicode::String (Tested with v2.06) [fink install unicode-string-pm581]
	- XML::Parser (Tested with v2.30) [fink install xml-parser-pm581]
	
	- Apache (should be installed by mod_perl above) Hmm, ./configure
	complains about not being able to find Apache2. Also installed
	Bundle::Apache2 with cpan, although it now looks like this may have
	been unnecessary. Installing Apache2::Util seems to be the more
	correct option. Argh!

	- Maybe also CGI, Carp, Cwd, Data::Dumper, Digest::MD5,
	File::Basename, File::Copy, File::Find, File::Path, Getopt::Long,
	Pod::Usage, Sys::Hostname

5. Install XML::GDOME if required. Leave this for now as it's easier (!) to
set up without it.

	Needs XML-LibXML-Common, XML-NamespaceSupport, XML-GDOME.
	Download from http://gdome2.cs.unibo.it/#downloads.

6. Install wget, tar, gunzip and unzip (if necessary). (Tested with wget 1.6.)

7. Install tools for full-text indexing (if necessary):
	- pdftotext (in xpdf)
	- wvware ("It can be a bit of a bit of a pain to install.")
	- lynx

8. Install LaTeX support tools (if necessary):
	- teTeX (for latex, dvips)
	- ImageMagick (for convert)

9. Install ePrints.

	EPrints needs to be installed as the same user as the apache
	webserver runs as. We suggest you install it as user "eprints" and
	group "eprints". Apache will need to be reconfigured to run as this
	user if so. I won't bother for the quick and dirty test --- I'll
	just run ePrints run as "www/www".
	
	% ./configure --prefix=/usr/local/eprints --with-user=www --with-group=www --with-apache=2 --with-smtp-server=sobmail1.commerce.otago.ac.nz
	
	To set up free space checking:
	% cd /usr/include
	% sudo /usr/bin/h2ph * */*
	(directory /Library/Perl/5.8.6/darwin-thread-multi-2level must exist)
	
	% sudo ./install.pl


Setup
=====

1. Configure and (re)start Apache.

	- Add to httpd.conf:
		Include /usr/local/eprints/cfg/apache.conf
		User www (should be already)
		Group www (should be already)
		LoadModule perl_module /sw/lib/apache2/modules/mod_perl.so

2. Start and configure MySQL.

	% cd /usr/local/mysql
	% scripts/mysql_install_db
	% ./bin/mysql -u root -p
	
	- Set root passwords. It appears that you need to use the old
	password model for compatibility with the current version of
	DBI::MySQL? And yet when you run it, it specifically says that it's
	using ols passwords, which implies that DBI knows about this.
	Durr...  It works though --- without old password format, you can't
	connect to the database ("Client does not support authentication
	protocol").

	mysql> SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('bl@rgh');
	mysql> SET PASSWORD FOR 'root'@'ou075110.otago.ac.nz' = OLD_PASSWORD('bl@rgh');
	
	- Remove anonymous accounts.
	
	mysql> DELETE FROM mysql.user WHERE User = '';
	mysql> FLUSH PRIVILEGES;

3. Configure ePrints.

	% su www
	% cd /usr/local/eprints
	% ./bin/configure_archive

	Doesn't seem to like unusual characters in the database password.
	(barnacle)

	% ./bin/generate_apacheconf
	% ./bin/create_tables archive_test_1
	
	% ./bin/import_subjects archive_test_1
	- If you do not specify the subjects file name then the system will
	use "subjects" from the given archive's cfg directory.
	- Must answer "yes" in full to continuation prompt.
	
	% ./bin/generate_static archive_test_1
	% ./bin/create_user archive_test_1 admin nstanger@infoscience.otago.ac.nz admin blobby
	% ./bin/generate_views archive_test_1
	
	- Edit archives/archive_test_1/cfg/auto-apache-conf (even though
	they say not to):
	
		Fix the "deny, allow" entries (remove the space).
		Change the "Alias /" directive to something like "Alias /eprints".
		You'll need to adjust a few paths in other parts of the file to match.
	
	- Stop & start Apache.


