Newer
Older
Digital_Repository / EPrints / ePrints with Fink notes.txt
nstanger on 12 Nov 2005 7 KB - Second attempt at importing!
  1. Installation
  2. ============
  3.  
  4. Install mysql [not necessary if connecting to a remote MySQL server].
  5.  
  6. % fink install mysql
  7. % sudo daemonic enable mysql
  8.  
  9.  
  10. Install Apache [with SSL if required]. OR: just use the built-in Apache
  11. (1.3.3), as it seems to just work out of the box with this (with
  12. mod_perl 1.x).
  13.  
  14. % fink install apache2[-ssl]
  15. % sudo daemonic enable apache2
  16.  
  17.  
  18. Perl 5.8.1 (10.3) or 5.8.6 (10.4) should already be there.
  19.  
  20.  
  21. Install the latest version of the Perl CGI package (need at least 3.08
  22. for mod_perl 2).
  23.  
  24.  
  25. Install mod_perl 2 [note mod_perl 1 is already included with the
  26. built-in Apache 1.3]. No Fink package), so must install manually. This
  27. includes the Apache and Apache2 Perl modules required by ePrints.
  28. Presumably it will build to whatever the current system version of Perl
  29. is.
  30.  
  31. % perl Makefile.PL MP_APXS=/sw/sbin/apxs
  32. % make
  33. % make test
  34. % sudo make install
  35.  
  36.  
  37. Install required Perl modules.
  38.  
  39. % fink install data-showtable-pm [Data::ShowTable]
  40. % fink install dbi-pm58x [DBI]
  41. % fink install dbd-mysql-pm58x [DBD::MySQL]
  42. % fink install mime-base64-pm58x [MIME:Base64]
  43. % fink install unicode-string-pm58x [Unicode::String]
  44. % fink install xml-parser-pm58x [XML::Parser]
  45.  
  46. Msql-Mysql Module: It appears that this is actually the DBD::MySQL
  47. module. Apparently this requires access to .h and library files from
  48. MySQL.
  49. Maybe (but probably not) CGI, Carp, Cwd, Data::Dumper, Digest::MD5,
  50. File::Basename, File::Copy, File::Find, File::Path, Getopt::Long,
  51. Pod::Usage, Sys::Hostname
  52. Probably worth installing the most recent version of the CGI module,
  53. as it fixes a known forms problem with Apache 2 [not necessary for
  54. Apache 1 unless you have a really old version]. Can't install with
  55. Fink as it only lists it as a virtual package. Install manually with
  56. cpan instead.
  57.  
  58. Install XML::GDOME if required. Leave this for now as it's easier to
  59. set up without it. It needs XML-LibXML-Common, XML-NamespaceSupport,
  60. XML-GDOME. Download from http://gdome2.cs.unibo.it/#downloads.
  61.  
  62.  
  63. Install miscellaneous utilities (if necessary) [note these are only
  64. needed for compressed file uploads and snarfing documents from URLs ---
  65. I think both features can be turned off].
  66.  
  67. % fink install wget
  68. Tar, gunzip and unzip are all base Fink packages and thus available
  69. by default.
  70.  
  71.  
  72. Install tools for full-text indexing (if necessary).
  73.  
  74. % fink install xpdf [for pdftotext]
  75. % fink install lynx
  76. % fink install wv2 [= wvware]
  77.  
  78.  
  79. Install LaTeX support tools (if necessary).
  80.  
  81. % fink install tetex [for latex, dvips]
  82. % fink install imagemagick [for convert]
  83.  
  84.  
  85. Install ePrints.
  86.  
  87. % sudo mkdir /Library/Perl/5.8.x/darwin-thread-multi-2level
  88. [if it doesn't already exist]
  89. % cd /usr/include
  90. % sudo /usr/bin/h2ph * */* [to set up free space checking]
  91. [this will probably eventually become (??)
  92. /usr/bin/h2ph -d /sw/lib/perl5/5.8.1/darwin * */*]
  93. % pushd bin; sed -i -e "s/deny, allow/deny,allow/g" generate_apacheconf; chmod 755 generate_apacheconf; popd
  94. [Apache treats "deny, allow" as two separate arguments and complains]
  95.  
  96. EPrints needs to be installed as the same user as the apache
  97. webserver runs as. We suggest you install it as user "eprints" and
  98. group "eprints". Apache will need to be reconfigured to run as this
  99. user if so. I won't bother for the quick and dirty test --- I'll
  100. just run ePrints as "www/www".
  101. % ./configure --prefix=/usr/local/eprints --with-user=www --with-group=www --with-apache=2 --with-smtp-server=whatever
  102. % sudo ./install.pl
  103.  
  104.  
  105. Setup
  106. =====
  107.  
  108. Start and configure MySQL.
  109.  
  110. % sudo /Library/StartupItems/daemonic-mysql/daemonic-mysql start
  111. % mysql -u root
  112. Set root passwords. It appears that you need to use the old password
  113. model for compatibility with the current version of DBI::MySQL.
  114. Without old password format, you can't connect to the database
  115. ("Client does not support authentication protocol").
  116.  
  117. mysql> SET PASSWORD FOR 'root'@'localhost' = OLD_PASSWORD('bl@rgh');
  118. mysql> SET PASSWORD FOR 'root'@'ou075110.otago.ac.nz' = OLD_PASSWORD('bl@rgh');
  119. Remove anonymous accounts.
  120. mysql> DELETE FROM mysql.user WHERE User = '';
  121. mysql> FLUSH PRIVILEGES;
  122.  
  123.  
  124. Configure ePrints.
  125.  
  126. % sudo -s -u www
  127. % cd /usr/local/eprints
  128. % ./bin/configure_archive
  129.  
  130. Doesn't seem to like unusual characters in the database password.
  131. (barnacle)
  132.  
  133. % ./bin/generate_apacheconf
  134. % ./bin/create_tables archive_test_1
  135. % ./bin/import_subjects archive_test_1
  136. - If you do not specify the subjects file name then the system will
  137. use "subjects" from the given archive's cfg directory.
  138. - Must answer "yes" in full to continuation prompt.
  139. % ./bin/generate_static archive_test_1
  140. % ./bin/create_user archive_test_1 admin nstanger@infoscience.otago.ac.nz admin blobby
  141. % ./bin/generate_views archive_test_1
  142. % ./bin/generate_abstracts archive_test_1
  143. % ./bin/indexer start
  144. [starts up the indexer daemon, otherwise no indexes are built!]
  145.  
  146. Configure and (re)start Apache.
  147.  
  148. Add to httpd.conf:
  149. User www [should be this already]
  150. Group www [should be this already]
  151. LoadModule perl_module /sw/lib/apache2/modules/mod_perl.so
  152. PerlHeaderParserHandler "sub { tie *STDOUT, 'Apache' unless tied *STDOUT; }"
  153. Include /usr/local/eprints/cfg/apache.conf
  154. [For Apache 1.3:
  155. LoadModule perl_module libexec/httpd/libperl.so
  156. AddModule mod_perl.c
  157. ]
  158. % sudo apachectl stop [/usr/sbin/apachectl for Apache 1.3]
  159. % sudo apachectl start [note: restart doesn't reload the configs!]
  160.  
  161.  
  162. Maintaining the system
  163. ======================
  164.  
  165. - bin/indexer must be running in the background for searching to work.
  166. - must run bin/generate_views periodically to rebuild the browse view pages.
  167.  
  168.  
  169. Advanced configuration
  170. ======================
  171.  
  172. You can configure the archive to run on a different domain on the
  173. same machine, while leaving the "primary" domain intact.
  174. In httpd.conf:
  175. - uncomment "NameVirtualHost *:80"
  176. - add:
  177. <VirtualHost *:80>
  178. ServerName primary1.domain.name
  179. ServerName primary2.domain.name
  180. ServerAdmin admin@primary.domain.name
  181. </VirtualHost>
  182.  
  183. In archive config XML file:
  184. <host>archive.domain.name</host>
  185. <adminemail>archive-admin@archive.domain.name</adminemail>
  186. Then ./bin/generate_apacheconf and restart Apache.
  187. You can also run on a different port to make things easier.
  188. (Remember to enable the Port and Listen directives in httpd.conf
  189. appropriately, and to let the ports through the firewall if
  190. necessary.)
  191. Much better, here are actual instructions!
  192. <http://wiki.eprints.org/w/EPrints2/EPrintsSetupUnderVirtualDirectoriesOtherThanRoot>
  193.  
  194.  
  195. Appearance
  196. ==========
  197.  
  198. Note for dynamically generated pages: they don't seem to handle XHTML
  199. comments properly, adding an extra unnecessary layer of <!-- --> around
  200. them, which makes the pages display weirdly. Better not to have any
  201. comments :)
  202.  
  203. If you change any of the templates (especially the top-level site template),
  204. you will need to generate_static, generate_abstracts, generate_views and
  205. possibly force_config_reload (or better, restart Apache).
  206.  
  207. ARCHIVE/cfg/template-en.xml global page template (customise header & footer)
  208. ARCHIVE/cfg/static/en/* individual static page templates (e.g., info page)
  209. ARCHIVE/cfg/general/* CSS templates and standard images
  210.  
  211. If you want to get a list of the latest items added on the front page,
  212. turn on SSI in httpd.conf then turn on Includes and XBitHack in
  213. ARCHIVE/cfg/apache.conf.
  214.  
  215. httpd.conf:
  216. uncomment "AddType text/html .shtml" and "AddHandler server-parsed .shtml"
  217. ensure that mod_include is enabled
  218. ARCHIVE/cfg/apache.conf: add
  219. <Directory "/usr/local/eprints/archives/ARCHIVEID/html">
  220. Options +Includes
  221. XBitHack on
  222. </Directory>
  223. Finally (fortunately permissions seem to be preserved when the HTML
  224. verison is generated):
  225. % chmod +x ARCHIVE/cfg/static/en/index.xpage
  226.  
  227.  
  228. Security
  229. ========
  230.  
  231. The most obvious way to set up a repository where only certain people can
  232. see the contents is to create a separate private repository on a different port,
  233. with no public registration.
  234.  
  235. Creating new user types appears to involve adding stuff to
  236. metadata-types.xml, phrases-en.xml and ArchiveConfig.pm.