Table of Contents
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
- Install Python headers for compiling pyxmpp & python_memcached (as root):
# apt-get install python-dev
- 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
- Check out the development branch of OpenSRF (as normal user):
$ svn co svn://svn.open-ils.org/OpenSRF/trunk
- Uncomment the Python build flag in
install.conf
(as normal user):OSRF_INSTALL_PYTHON=1
- Build everything (as normal user):
make
- Install everything (as root):
make install
Step 2: Installing the Evergreen Python environment
- Check out the acq-experiment branch of Evergreen (as normal user):
$ svn co svn://svn.open-ils.org/ILS/branches/acq-experiment
- 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
- In
install.conf
, ensure thatEG_PYTHON_INSTALL="Y"
. You can runmake config
in the Evergreen root directory and respond Y to theInstall Python modules?
question to set this, or edit your copy ofinstall.conf
directly. - Build everything (as normal user):
make
- 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
- Install the Pylons framework (as root):
# easy_install Pylons
- Install the Python libxml2 and libxslt modules (as root):
# apt-get install python-libxml2 python-libxslt1
- Install the Python mxDateTime class for handling ISO 8601 date formats (as root):
# apt-get install python-egenix-mxdatetime
- Install the Python dnspython module (as root):
# apt-get install python-dnspython
- 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). Adjustevergreen-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
- In the directory
/openils/var/web/oilsweb/
, copy the filedevelopment.ini
(which is under version control, and will get copied over top of any changes you make) to a new file calledlocaldev.ini
. Make it listen on all interfaces by setting thehost
variable in/openils/var/web/oilsweb/localdev.ini
to0.0.0.0
. You can also set it to listen on a specific IP address. Ensure the defaulthost
setting has been commented out.... [server:main] use = egg:Paste#http host = 0.0.0.0 #host = 216.154.195.227 port = 5000 ...
- Add open-ils.acq to /openils/conf/opensrf.xml.
- 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>
- Enable open-ils.acq for your server in the <hosts> section of the config. Add the following:
<appname>open-ils.acq</appname>
- 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
- 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.