User Tools

Site Tools


acq:installing_python

Installing the acq-admin environment

The following instructions are based on Debian Etch, but should be easily adapted for other distributions. These instructions assume that you've already followed the instructions for installing OpenSRF and Evergreen relevant to your distribution to satisfy all prerequisites.

Step 1: Installing the OpenSRF Python environment

  1. Install Python headers for compiling pyxmpp & python_memcached (as root):
    # apt-get install python-dev
  2. Upgrade to the latest version of setuptools (warning: this will overwrite your system package if you have already installed it) (as root):
    # easy_install --upgrade setuptools
  3. Check out the development branch of OpenSRF (as normal user):
    $ svn co svn://svn.open-ils.org/OpenSRF/trunk
  4. Uncomment the Python build flag in install.conf (as normal user):
    OSRF_INSTALL_PYTHON=1
  5. Build everything (as normal user):
    make
  6. Install everything (as root):
    make install

Step 2: Installing the Evergreen Python environment

  1. Check out the acq-experiment branch of Evergreen (as normal user):
    $ svn co svn://svn.open-ils.org/ILS/branches/acq-experiment
  2. There is one additional PostgreSQL prerequisite - the pgxml functions from the PostgreSQL contrib directory must be added to your Evergreen database:
    # replace with your username / database name / database version as required
    psql -U evergreen -d evergreen -f /usr/share/postgresql/8.2/contrib/pgxml.sql
  3. In install.conf, ensure that EG_PYTHON_INSTALL="Y". You can run make config in the Evergreen root directory and respond Y to the Install Python modules? question to set this, or edit your copy of install.conf directly.
  4. Build everything (as normal user):
    make
  5. Install everything (as root):
    make install

The install step of the acq-experiment branch creates an extra Web directory, /openils/var/web/oilsweb/, that contains the Pylons application that provides the acquisitions and administration interface.

(Aside: acq-experiment and trunk now require the Perl JSON::XS module, available as libjson-xs-perl in Debian testing but not yet available in Debian Etch (stable). Add the testing sources to your /etc/apt/sources.list and install the package as root:)

# apt-get update
# apt-get install -t testing libjson-xs-perl

Step 3: Setting up the Evergreen acquisition Web

  1. Install the Pylons framework (as root):
    # easy_install Pylons
  2. Install the Python libxml2 and libxslt modules (as root):
    # apt-get install python-libxml2 python-libxslt1
  3. Install the Python mxDateTime class for handling ISO 8601 date formats (as root):
    # apt-get install python-egenix-mxdatetime
  4. Install the Python dnspython module (as root):
    # apt-get install python-dnspython
  5. Install dnsmasq and append the following configuration lines to enable dnspython to see your Evergreen server in a development environment (dnspython cannot read /etc/hosts entries and relies entirely on DNS resolvers). Adjust evergreen-server.localdomain to match your development machine's hostname:
    # apt-get install dnsmasq
    # echo address=/evergreen-server.localdomain/127.0.0.1 >> /etc/dnsmasq.conf
    # echo nameserver 127.0.0.1 >> /etc/resolv.conf
  1. In the directory /openils/var/web/oilsweb/, copy the file development.ini (which is under version control, and will get copied over top of any changes you make) to a new file called localdev.ini. Make it listen on all interfaces by setting the host variable in /openils/var/web/oilsweb/localdev.ini to 0.0.0.0. You can also set it to listen on a specific IP address. Ensure the default host setting has been commented out.
    ...
    [server:main]
    use = egg:Paste#http
    host = 0.0.0.0
    #host = 216.154.195.227
    port = 5000
    ...
  2. Add open-ils.acq to /openils/conf/opensrf.xml.
    1. Add something like the following in with the rest of the service configs:
          <open-ils.acq>
              <keepalive>3</keepalive>
              <stateless>1</stateless>
              <language>perl</language>
              <implementation>OpenILS::Application::Acq</implementation>
              <max_requests>101</max_requests>
              <unix_config>
                 <unix_sock>open-ils.acq_unix.sock</unix_sock>
                 <unix_pid>open-ils.acq_unix.pid</unix_pid>
                 <max_requests>1000</max_requests>
                 <unix_log>open-ils.acq_unix.log</unix_log>
                 <min_children>3</min_children>
                 <max_children>15</max_children>
                 <min_spare_children>2</min_spare_children>
                 <max_spare_children>5</max_spare_children>
              </unix_config>
           </open-ils.acq>
    2. Enable open-ils.acq for your server in the <hosts> section of the config. Add the following:
      <appname>open-ils.acq</appname>
  3. Start the opensrf router, Perl applications, and C applications as the opensrf user:
    # su - opensrf
    $ osrf_ctl.sh /openils/conf/opensrf_core.xml -a start_router
    $ osrf_ctl.sh /openils/conf/opensrf_core.xml -a start_perl
    $ osrf_ctl.sh /openils/conf/opensrf_core.xml -a start_c
  4. Start the acquisitions and administration Web interface as the opensrf user:
    # su - opensrf
    $ cd /openils/var/web/oilsweb
    $ paster serve --reload localdev.ini

    You should see a response like:

    serving on 0.0.0.0:5000 view at http://127.0.0.1:5000

Accessing the acquisitions and administration web

Open the IP address of your Evergreen server in a Web browser, including port 5000 in the URL. For example, if the IP address is 211.211.211.211, open http://211.211.211.211:5000 in your browser. You should see a pretty "404 Error Not Found" Web page being served up by Pylons. This is good!

The URLs of interest to a Pylons application can be found in the routing.py file at /openils/var/web/oilsweb/oilsweb/config/routing.py, or in the Evergreen source at Open-ILS/web/oilsweb/oilsweb/config/routing.py.

Start with http:<ipaddress>:5000/oils/admin/ to see the default landing page for the acquisitions and administration Web application. You should receive an error like:<code> oilsweb.lib.AuthException: AuthException: No authentication token provided </code> This is good! Start a srfsh session and log in with a workstation to get an authentication token. For example, assuming you have already registered a workstation called BR1-circ:<code> srfsh# login admin open-ils staff 0 BR1-circ </code> You will be given an authentication token. Pass that token as a GET parameter named ses to the oilsweb application; for example: http://hostname:5000/oils/admin/?ses=ff099f96168f33788abd8e4a7a71fb70 This should grant you access to the oilsweb kingdom.

acq/installing_python.txt · Last modified: 2022/02/10 13:34 (external edit)

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.