Newer
Older
Digital_Repository / EPrints / ePrintsStats setup.txt
  1. Basic instructions in ePrintsStatsSetup.pdf (comes with distribution).
  2.  
  3. First:
  4.  
  5. % fink install geoip
  6. % cpan install Geo::IPfree
  7.  
  8.  
  9. Configuration
  10.  
  11. config/inc.vars.es.php
  12.  
  13. * connections/sqlpass_public => stats database password
  14. * connections/sqlserver => stats database server
  15. * filelocation/base_install_dir => /usr/local/eprints/ePrintsStats
  16. * general/admin_name, _email, support_name, _email => appropriate values
  17. * general/eprints_location => http://eprints.otago.ac.nz
  18.  
  19. scripts/eprints-usage.php
  20.  
  21. * $log_dir => /sw/var/apache2/logs/ (or possibly /var/log/httpd/)
  22. * $log_file: "UTasER" => stats datavase name ("otago_eprints")
  23. * $sqlserver => stats database server
  24. * $sqlpass => stats database password
  25. * $sqlserver2 => EPrints database server
  26. * $sqluser2 => otago_eprints
  27. * $sqlpass2 => otago_eprints password
  28.  
  29. scripts/add_country.pl
  30.  
  31. * $dsn => stats database server (DBI DSN)
  32. * $password => stats database password
  33.  
  34. sql/db.schema.eprintstats.sql
  35.  
  36. * change both stats database passwords at end (do you need to use OLD_PASSWORD?)
  37.  
  38. vhost/apache.conf
  39.  
  40. Alias /es => /usr/local/eprints/ePrintsStats/htdocs
  41. php_admin_value error_log => "/usr/local/eprints/ePrintsStats/logs/php.error.log"
  42. php_admin_value open_basedir => "/usr/local/eprints/ePrintsStats:/usr/local/lib/php"
  43. php_admin_value include_path ".:/usr/local/eprints/ePrintsStats/includes:/usr/local/eprints/ePrintsStats/config:/usr/local/lib/php"
  44. (may need to change php lib paths depending on environment, e.g., on
  45. my machine it's /sw/lib/php4)
  46.  
  47. Fixes to scripts/eprints-usage.php:
  48. The script is set up for "long" EPrints URLs for documents, of the
  49. form /archive/00000023/01/foo.pdf. If short_urls is turned on, the
  50. regular expressions won't match (short URLs look like /23/01/foo.pdf).
  51. The solution is to add a regex for short URLs to the ifs on lines 65
  52. and 86:
  53. 65: || (preg_match("/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(.*?)\] \"GET \/(\d{1,4}).*? HTTP\/1..\" 200 .*/i",$buffer,$matches))
  54.  
  55. 86: || preg_match("/GET \/\d{1,4}\/\d\d\//i",$buffer)
  56.  
  57.  
  58. There appears to be an extra inc.html.footer.es.php in htdocs that
  59. shouldn't be there (it overrides the same file in includes). Also
  60. apparently unnecessary are header.html, footer.html and phpinfo.php.
  61.  
  62. EPrints config changes
  63.  
  64. EXTREMELY IMPORTANT! Add '/es' to rewrite_exceptions.
  65. In otago_eprints/cfg/apachevhost.conf:
  66. Include /usr/local/eprints/ePrintsStats/vhost/apache.conf
  67.  
  68.  
  69. Geo::IPfree config
  70.  
  71. % cd <PERL5LIB>/Geo
  72. Then follow the instructions in the ePrintsStats document.