[OPEN-ILS-DEV] method "opac_visible"

Pierre Nault pierrenault at gmail.com
Tue Nov 6 12:25:11 EST 2007


Skipped content of type multipart/alternative-------------- next part --------------
====== Installing Evergreen on Ubuntu 7.04 ======

**WARNING:** If you are installing a version of Evergreen later than 1.1.x, make sure to consult [[installing_evergreen_1.2.x_on_ubuntu_7.04|the updated instructions]].

This page will attempt to explain the install of the Evergreen ILS on Ubuntu 7.04 (Feisty Fawn) from beginning to end.  It makes only limited use of other Evergreen Wiki pages because it was generally written with a very novice user in mind.

Start with a standard install of Ubuntu 7.04 Desktop.  Please search the Internet if you require help with this step (though maybe you shouldn't be attempting this anyway :-) ) For these instructions, the following choices were made during install:\\
Username: evergreen-admin\\
Password: everPass\\
Computer Name: eg-server

**Notice (esp. if using Ubuntu Server):**\\
Each place in these instructions where we use the name 'eg-server,' we are actually using the computer's fully-qualified domain name (or at least what the machine believes it to be).  On machines without a real fqdn, Ubuntu Desktop will default to using simply the computer name (in our case, eg-server), but Ubuntu Server will append .localdomain, so your fqdn ends up as eg-server.localdomain .  In any case, it is probably good advice to run the following:<code>perl -MNet::Domain=hostfqdn -e "print hostfqdn();"</code>and then substitute the output of this command everywhere in these instructions where you see eg-server being used.  You should also be sure that the value returned here actually resolves!  Name assignment and resolution can be a tricky business so please make sure this is rock-solid before continuing.
**Tip:**
If the above perl command returns something like machinename.somedomain.com but the command 'hostname -f' returns machinename.localdomain AND the name given by perl does not resolve (you can check with 'ping machinename.somedomain.com') but the name given by hostname does, try the following.  In /etc/resolve.conf, add 'localdomain' as the first argument to 'search', so the line looks something like:<code>search localdomain somedomain.com</code>If there is no 'search' line, you can try to add it. **Warning:** If your DNS settings are set via DHCP, you will need to redo this step whenever DHCP renews (at least every reboot).  It may be best to find some manual settings that work reliably.

Please adapt all following instructions to suit your own choices to the above settings. Also, if you are not familiar with it, Ubuntu uses sudo for root level actions.  This means most commands needing root access must be prefixed with sudo, i.e.:
sudo apt-get install whatever

  - (optional) Allow the auto-update to do its thing (this worked alright as of 4/23/07)
  - Enable Universe sources in /etc/apt/sources.list by uncommenting (removing the # from the start of the line) or adding these lines (if necessary, it wasn't on my build) (you will need to employ sudo to edit the file):<code>
deb http://us.archive.ubuntu.com/ubuntu/ feisty universe
deb http://security.ubuntu.com/ubuntu feisty-security universe
</code>This gives you access to a much larger pool of software packages to install. If you had to uncomment (or add) the lines you’ll need to update the list of available packages:<code>apt-get update</code>
  - Choose a directory for downloading and saving the necessary sources.  For our install we used /home/evergreen-admin/eg-srcs/.  If you choose a directory outside of your user's home, you will probably need to add 'sudo' to most of the build commands (e.g. make) in order to have them function properly.
  - Download and unpack the following to the directory you just chose:
    * Stable build of Evergreen (we used 1.0.4.1) from Open-ILS [[http://www.open-ils.org/downloads.php|downloads]].
    * libjs (we used 1.60) from [[http://ftp.mozilla.org/pub/mozilla.org/js/|Mozilla]].
    * JavaScript::SpiderMonkey (we used 0.17) from [[http://search.cpan.org/~tbusch/JavaScript-SpiderMonkey-0.17/SpiderMonkey.pm|CPAN]].
    * libdbi (we used 0.8.2) from [[http://sourceforge.net/project/showfiles.php?group_id=23824|Sourceforge]].
    * libdbi-drivers (we used 0.8.2-1) from [[https://sourceforge.net/project/showfiles.php?group_id=65979|Sourceforge]].
	* OpenSRF from [[http://www.open-ils.org/downloads.php]].
  - Install sendmail if you intend to use this machine for generating email notices (this is untested, but I think it will work):<code>sudo apt-get install sendmail</code>
  - You will probably want to install ssh for remote access:<code>sudo apt-get install openssh-server</code> (it may already be installed).
  - Install the following packages used for building from sources (some may already be installed):<code>sudo apt-get install cvs make gcc</code>
  - Install Perl package dependencies:<code>sudo apt-get install \
 libcache-memcached-perl \
 libcgi-perl \
 libclass-dbi-abstractsearch-perl \
 libdatetime-perl \
 libdbd-pg-perl \
 libdbd-sqlite3-perl \
 liberror-perl \
 libexception-class-perl \
 libgd-graph3d-perl \
 libmd5-perl \
 libmodule-build-perl \
 libnet-server-perl \
 libspreadsheet-writeexcel-perl \
 libtemplate-perl \
 libtext-aspell-perl \
 libtext-csv-perl \
 libunix-syslog-perl \
 libxml-libxml-perl \
 libxml-libxslt-perl \
 libxml-simple-perl \
 libuniversal-require-perl \
 liblog-log4perl-perl \
 libmarc-record-perl \
 libmarc-charset-perl \
 libnet-z3950-perl \
 libemail-send-perl \
 libtext-csv-perl</code>
  - The following two packages are not in the Ubuntu repository, and will need to be loaded directly from CPAN.  You can accept all the defaults when doing the CPAN setup, and can leave the proxy settings blank (unless of course you actually need them).  When you get to the part where you choose a CPAN repository, try to choose one close to you.  Then run:<code>sudo perl -MCPAN -e 'install DateTime::Format::ISO8601'
sudo perl -MCPAN -e 'install MARC::File::XML'</code>Go ahead and answer 'yes' to install any extra prerequisites you need as CPAN runs.
  - Install build prerequisites:<code>sudo apt-get install \
  libapache2-mod-perl2 \
  apache2-mpm-prefork \
  apache2-prefork-dev \
  automake \
  libreadline5-dev \
  libtool \
  libxslt1-dev \
  memcached \
  postgresql-8.2 \
  postgresql-contrib-8.2 \
  postgresql-plperl-8.2 \
  postgresql-server-dev-8.2 \
  libmemcache-dev</code>
  - Install libjs by running the following in src/ directory within the unpacked libjs directory from above (in our case /home/evergreen-admin/eg-srcs/js/src/):<code>make -f Makefile.ref
sudo cp Linux_All_DBG.OBJ/libjs.* /usr/local/lib/.
sudo cp Linux_All_DBG.OBJ/*.h /usr/local/include/.
sudo cp *.h /usr/local/include/.
sudo cp *.tbl /usr/local/include/.</code>
  - We have to install SpiderMonkey by hand in order to ensure that we get the -E4X flag.  Install SpiderMonkey by running the following in the unpacked SpiderMonkey directory from above (in our case /home/evergreen-admin/eg-srcs/JavaScript-SpiderMonkey-0.17/) :<code>perl Makefile.PL -E4X
make
sudo make install</code>
  - Install ejabberd:<code>sudo apt-get install ejabberd</code>
  - In the unpacked libdbi directory from above (in our case /home/evergreen-admin/eg-srcs/libdbi-0.8.2/), update aclocal.m4 by running <code>sudo aclocal</code>
  - Install libdbi by running the following in the same unpacked directory:<code>sudo ./autogen.sh
./configure --disable-docs
make all
sudo make install</code>
  - In the unpacked libdbi-drivers directory from above (in our case /home/evergreen-admin/eg-srcs/libdbi-drivers-0.8.2-1/), update aclocal.m4 by running <code>sudo aclocal</code> again
  - Install libdbi-drivers by running the following in the same unpacked directory:<code>sudo ./autogen.sh
./configure --disable-docs --with-pgsql --enable-libdbi
make all
sudo make install</code>
  - Set up PostgreSQL:
    * Change PostgreSQL defaults to allow for password authentication both locally and when specifying the hostname\\ in /etc/postgresql/8.2/main/pg_hba.conf\\ change:<code>local   all    all   ident sameuser</code>to:<code>local   all    all   md5</code>also add:<code>host    all    all    127.0.1.1/32   md5</code>
    * If you have a static IP which your hostname resolves to (which should then be found in /etc/hosts), use that instead of 127.0.1.1 in the last line above.
    * In /etc/postgresql/8.2/main/postgresql.conf, listen_addresses should be uncommented and reflect both your localhost name and your machine name.  In our case it reads:<code>listen_addresses = 'localhost,eg-server'</code>
    * Restart PostgreSQL server<code>sudo /etc/init.d/postgresql-8.2 restart</code>
    * Create the superuser 'evergreen' (we again chose password everPass):<code>sudo -u postgres createuser -U postgres -s -P evergreen</code> NOTE: You will be prompted a couple of times for passwords.  "Enter password for new role" and "Enter it again" refers to what you want the password to be for the "evergreen" user; "password" refers to the current password of the "postgres" SQL user.  If you don't know this password, see [[http://paste.lisp.org/display/49745#1|here]] for tips.  "CREATE ROLE" indicates this step was successful.
  - Prepare the evergreen database
    * Enable full text search extension in the template database:<code>sudo -u postgres psql template1 < /usr/share/postgresql/8.2/contrib/tsearch2.sql</code> NOTE: if prompted for "Password:", you will need to enter the password of the 'postgres' user.  You may also get "NOTICE: type ... is not yet defined".  This is normal.
    * Enable table function extension in the template database:<code>sudo -u postgres psql template1 < /usr/share/postgresql/8.2/contrib/tablefunc.sql</code>NOTE: if prompted for "Password:", you will need to enter the password of the 'postgres' user.  You may also get "NOTICE: type ... is not yet defined".  This is normal.
    * Add the plpgsql language to the template database:<code>sudo -u postgres createlang plpgsql -d template1</code>NOTE: if prompted for "Password:", you will need to enter the password of the 'postgres' user.  You may also get "NOTICE: type ... is not yet defined".  This is normal.
    * Create the database 'evergreen' with Unicode (UTF-8) encoding:<code>sudo createdb -W -U evergreen -E UTF8 evergreen</code>NOTE: "Password:" now indicates the password you set for the 'evergreen' user.
    * Add plperl and plperlu languages to evergreen:<code>sudo -u postgres createlang plperl -d evergreen
sudo -u postgres createlang plperlu -d evergreen</code>NOTE: if prompted for "Password:", you will need to enter the password of the 'postgres' user.  You may also get "NOTICE: type ... is not yet defined".  This is normal.
  - Building OpenSRF:
  * Download and decrompress to wherever_you_want/OpenSRF-0.9/
  * Edit OpenSRF-0.9/Makefile, adding, at the top, the line:
  SHELL=/bin/bash
  * Leave all options in install.conf at the defaults.
  * The following lines must be added to /etc/apache2/httpd.conf in order to allow apxs2 to function as expected during our make install (the file should exist but will probably be blank):
  # This is here for apxs compatibility (and this comment is required!)
  #LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so
  * In OpenSRF-0.9/ directory, run:
  CFLAGS=-D_LARGEFILE64_SOURCE make all
  sudo make install
  - Building OpenILS:
  * In Evergreen-ILS-1.2.0-rc1/ directory, run:
  make config
  * Select all defaults, with the following exceptions:
  Build_targets [openils_all evergreen_core]   !!!!IMPORTANT!!!!
  Database Host [your_host_name_here]     (eg-server if you followed the wiki)
  Database Name [evergreen]     (if you followed the wiki)
  Database User [evergreen]     (if you followed the wiki)
  Database Password [everPass]     (if you followed the wiki)
  * Run:
  CFLAGS=-D_LARGEFILE64_SOURCE make
  sudo make install
  * Enter password, repeatedly, as needed for database build
  * The install prompts you to run "chown -R opensrf:opensrf /openils/".  You may ignore this for now, as we do this step a bit later.
  - Setting up apache
    * While still in the Evergreen source directory, copy over the included apache example files:<code>sudo cp Open-ILS/examples/apache/*.conf /etc/apache2/sites-available/
sudo cp Open-ILS/examples/apache/startup.pl /etc/apache2/</code>
    * Edit one of the conf files you just copied, /etc/apache2/sites-available/eg.conf:
      * In your cgi-bin Directory node, change the 'Allow from' line to something suitable for limited access to the configuration scripts in the cgi-bin:\\ (in our case)<code>Allow from 10.0.0.1/8</code>became:<code>Allow from 127.0.0.0/16</code>
      * Change the two ServerName directives to something appropriate:<code>ServerName eg-server:80</code>and:<code>ServerName eg-server:443</code>
      * Change the two ServerAlias directives to something appropriate:<code>ServerAlias 127.0.1.1:80</code>and:<code>ServerAlias 127.0.1.1:443</code>
      * Change the two:<code>Include eg_vhost.conf</code>lines to:<code>Include sites-available/eg_vhost.conf</code>
    * Edit /etc/apache2/apache2.conf:
      * Change:<code>User www-data</code>to:<code>User opensrf</code>
    * Make startup.pl executable:<code>sudo chmod 755 /etc/apache2/startup.pl</code>
    * Enable your eg site:<code>sudo a2ensite eg.conf</code>
    * Disable the default site:<code>sudo a2dissite 000-default</code>
    * Enable the needed apache2 modules:<code>sudo a2enmod deflate
sudo a2enmod expires
sudo a2enmod include
sudo a2enmod rewrite
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod disk_cache</code>
    * Create a basic ssl certificate:<code>sudo mkdir /etc/apache2/ssl
cd /etc/apache2/ssl
sudo openssl req -new -x509 -nodes -out server.crt -keyout server.key</code>Use any values you want for the certificate information prompts.
    * Create a file named /etc/ld.so.conf.d/evergreen.conf with the following lines in it:<code>/usr/local/lib
/usr/local/lib/dbd
/openils/lib</code>
    * To make this ld setting active run:<code>sudo ldconfig</code>
  - Setting up ejabberd
    * Make the following changes to /etc/ejabberd/ejabberd.cfg\\ Change Admin User setting from:<code>{acl, admin, {user, "", "localhost"}}.</code>to:<code>{acl, admin, {user, "evergreen"}}.
{acl, admin, {user, "router"}}.</code>
    * Change maximum user connects from:<code>{max_user_sessions, 10}.</code>to:<code>{max_user_sessions, 1000}.</code>
    * Change the hosts section as appropriate:<code>{hosts, ["localhost"]}.</code>to:<code>{hosts, ["localhost","eg-server"]}.</code>Ubuntu 7.04 has this line twice, make sure to use the uncommented one (near the top)!
    * Change any max_stanza_size lines to 2000000. This ensures that you can send large message through the server.
    * Change any “shaper” lines (there should be two of them like so : {shaper, normal, {maxrate, XYZ}}) to a maxrate of 500000.
    * Comment out the mod_offline module setting to prevent offline storage of messages (**Notice:** One user has reported that this line is already commented out by default).\\ Should look something like this:<code>%{mod_offline, []},</code>
    * Save the file and restart ejabberd:<code>sudo /etc/init.d/ejabberd force-reload</code>
    * Register two new Jabber accounts with the ejabberd server using ejabberdctl. The username / password pairs should match the corresponding values you will later set in conf/bootstrap.conf, conf/opensrf_core.xml, and conf/openils.xml (**in 1.0.x**) or conf/opensrf.xml (**in 1.1.x and later**).  One of the accounts should definitely be named 'router' for system reasons. If for whatever reason you decide to change these account names, make sure you change the 'acl' lines added above as well.<code># syntax: sudo ejabberdctl register <username> <hostname> <password>
sudo ejabberdctl register evergreen eg-server everPass
sudo ejabberdctl register router eg-server everPass</code>
    * Restart ejabberd once more:<code>sudo /etc/init.d/ejabberd force-reload</code>
  - Setting up Evergreen:
	* Go to your installed Evergreen directory
  cd /openils/
  * Create the TWO main configuration files:
  sudo cp conf/opensrf_core.xml.example conf/opensrf_core.xml
  sudo cp conf/opensrf.xml.example conf/opensrf.xml
  * Edit opensrf.xml.  In each <database> node, change the settings as appropriate:
  <database>
    <driver>Pg</driver>
    <host>eg-server</host>
    <port>5432</port>
    <name>evergreen</name>
    <user>evergreen</user>
    <password>everPass</password>
  </database>
      * In the <reporter><base_uri> node, set the URI to match your webserver name:<code><base_uri>https://eg-server/reporter/</base_uri></code>
      * In the <hosts> node, make sure the child node tags (both opening and closing) match the hostname of your server (as returned by the 'hostname -f' command):<code><hosts>
  <eg-server>
  ...
  </eg-server>
</hosts></code>
      * Ensure the memcache settings node is set to:<code><server>localhost:11211</server></code>this is the default memcache port on Ubuntu.
    * Edit opensrf_core.xml
      * Set the <config><routers><router> node:<code><router>eg-server</router></code>
      * Set the <config><domains><domain> node:<code><domain>eg-server</domain></code>
      * Set <username> and <passwd>:<code><username>evergreen</username>
<passwd>everPass</passwd></code>
      * Set the <gateway><client><domains><domain> node:<code><domain>eg-server</domain></code>
      * Set <username> and <passwd> again to:<code><username>evergreen</username>
<passwd>everPass</passwd></code>
      * (**Deprecated and may not be present (affecting next step as well)**) Set the <rest_gateway><domains><domain> node:<code><domain>eg-server</domain></code>
      * Set <username> and <passwd> again to:<code><username>evergreen</username>
<passwd>everPass</passwd></code>
      * Within the <router> node, change every mention of 'localhost' to your ejabberd server:<code><server>eg-server</server></code>...and so on.
      * Still within the <router> node, change the <password> node to match your ejabber router user password, leaving the username as router:<code><password>everPass</password></code>We set our passwords the same when we created our ejabber accounts above.
    * Create the reporter directory:<code>sudo mkdir /openils/var/reporter</code>
    * Make the cgis executable:<code>sudo chmod 755 /openils/var/cgi-bin/*.cgi</code>
  * Add the following lines to the top of /openils/bin/autogen.sh and /openils/bin/osrf_ctl.sh (after the #!/bin/bash line).  There are other ways to accomplish this, but this is one of the simplest and least intrusive:
  export PATH=$PATH:/openils/bin
  export PERL5LIB=/openils/lib/perl5
    * Make sure all the openils stuff is owned by opensrf:<code>sudo chown -R opensrf:opensrf /openils</code>
    * Copy the srfsh config file to your home directory as a hidden file:<code>cp /openils/conf/srfsh.xml.example ~/.srfsh.xml</code>
    * Edit the .srfsh.xml file to match your ejabber domain and username/password.  The logfile can be in any directory where your user has write permission.
  - Starting the system
  * Start OpenILS
  sudo -u opensrf /openils/bin/osrf_ctl.sh -c /openils/conf/opensrf_core.xml -a start_all
  * Start (or restart) apache
  sudo /etc/init.d/apache2 start
  If you are not using a fully qualified domain name, you may get a notice for that, but apache will still start fine.
  - Creating the Outreach and Trustee Groups:
This should change in the future, but at the time of this writing, there are apparently some portions of the code which are still Pines specific.  One of these (circulation rules) requires groups named Outreach and Trustee.  These two groups must be created using the CGI config files (http://eg-server/cgi-bin/config.cgi).  From the main config page, click on User Groups and Permissions, then on Users, then fill in the New Child boxes appropriately for each group (at the bottom of the page) and click Add New.  When finished, it seems we should restart the system to get the changes to take full effect:<code>sudo -u opensrf /openils/bin/osrf_ctl.sh -c /openils/conf/opensrf_core.xml -a stop_all</code> wait for activity to stop or use ps to verify that all the services have stopped, then <code>sudo -u opensrf /openils/bin/osrf_ctl.sh -c /openils/conf/opensrf_core.xml -a start_all</code>  
  - Finalize the OPAC.  This command will create all the needed Javascript files to make the OPAC functional (this must be run from /openils/bin):
  sudo -u opensrf ./autogen.sh /openils/conf/opensrf_core.xml  
  - Default admin account info\\ The default admin is account is:\\ Username: admin\\ Password: open-ils\\ You can use these to login to the client and/or the OPAC.
  - Building the Client
    * From within your Evergreen source, change to the Open-ILS/xul/staff_client directory.  Once there, do the following (where 12345 is a number of your own choosing):<code>make STAFF_CLIENT_BUILD_ID='12345'
sudo mkdir /openils/var/web/xul/12345/
cd build/
sudo cp -R server/ /openils/var/web/xul/12345/</code>Again make sure all the openils stuff is owned by opensrf:<code>sudo chown -R opensrf:opensrf /openils/</code>
    * If you wish, you can run the client like so:<code>sudo apt-get install xulrunner</code>(then in the build directory)<code>xulrunner application.ini</code>
    * You can also do the same by tarring up the build directory, copying it to a Windows machine, installing XULRunner from Mozilla, and running the Windows XULRunner executable with the same application.ini.


More information about the Open-ils-dev mailing list