User Tools

Site Tools


redhat_evergreen_trunk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

redhat_evergreen_trunk [2010/05/21 11:25]
leed
redhat_evergreen_trunk [2022/02/10 13:34]
Line 1: Line 1:
-======Installing Evergreen Trunk on Redhat ====== 
-The following steps have been tested on Redhat x86 (32-bit) and x86-64 (64-bit) architectures.  
- 
-In the following instructions, you are asked to perform certain steps as either the **root** user, the **opensrf** user, or the **postgres** user. To become the **root** user, issue the su - command and enter the password of the root user. 
- 
-To switch from the root user to a different user, issue the su - <username> command; for example, su - **opensrf**. Once you have become a non-root user, to become the root user again simply issue the exit command.  
- 
-  - [[redhat_opensrf_trunk|Install the latest version of OpenSRF trunk]]. Follow the steps and run the test to ensure that OpenSRF is properly installed before continuing with any further Evergreen installation steps. Evergreen is an application that has been built on top of the Open Service Request Framework (OpenSRF), so if OpenSRF doesn't work, Evergreen isn't going to work.  
-  - Download and build Evergreen: 
-    - As the **opensrf** user, download and patch the latest version of Evergreen trunk:<code bash> 
-cd ~ && svn checkout svn://svn.open-ils.org/ILS/trunk Evergreen-trunk 
-wget http://esilibrary.com/~ldickens/rhel-evg/evergreen-rhel.diff 
-cd Evergreen-trunk 
-patch -p0 < ../evergreen-rhel.diff 
-</code> 
-    - As the **root** user, install the prerequisites:<code bash> 
-cd /home/opensrf/Evergreen-trunk 
-make -f Open-ILS/src/extras/Makefile.install rhel</code> 
-This will install a number of packages required by OpenSRF on your system, including some Perl modules from CPAN. You can say “no” to the initial CPAN configuration prompt to allow it to automatically configure itself to download and install Perl modules from CPAN. The CPAN installer will ask you a number of times whether it should install prerequisite modules - say “yes”.  
-    - As the **root** user, add ''/usr/local/lib/dbd'' to the system dynamic library path and make Linux recognize the newly installed libraries. Then restart PostgreSQL to avoid a problem where ''plperl.so'' cannot be found: 
-      - Create a file named ''/etc/ld.so.conf.d/eg.conf'' containing the following lines:<code> 
-/usr/local/lib/dbd</code> 
-      - Run the following commands:<code bash> 
-ldconfig 
-chkconfig --levels 345 postgresql on #to start up postgres on boot 
-service postgresql initdb 
-vi /var/lib/pgsql/data/pg_hba.conf</code> 
-      - Edit the pg_hba.conf file to contain only the following lines:<code bash> 
-local all all trust  
-host all all 127.0.0.1 255.255.255.255 trust</code> 
-      - Restart the postgresql server:<code bash> 
-/etc/init.d/postgresql restart</code> 
-    - As the **opensrf** user, configure and compile Evergreen:<code bash> 
-cd /home/opensrf/Evergreen-trunk 
-cat /usr/share/aclocal/libtool.m4 /usr/share/aclocal/ltoptions.m4 /usr/share/aclocal/ltversion.m4 /usr/share/aclocal/ltsugar.m4 /usr/share/aclocal/lt~obsolete.m4 >> aclocal.m4 
-./autogen.sh 
-./configure --prefix=/openils --sysconfdir=/openils/conf 
-make</code> 
-    - As the **root** user, install the code. Set the ''STAFF_CLIENT_BUILD_ID'' variable to match the version of the staff client you will use to connect to the Evergreen server. Create a symbolic link named ''server'' in ''/openils/var/web/xul/'' to the ''/server/'' subdirectory of your staff client build.<code bash> 
-cd /home/opensrf/Evergreen-trunk 
-make STAFF_CLIENT_BUILD_ID=current install 
-cd /openils/var/web/xul 
-ln -sf current/server server</code> 
-    - Copy the example OpenSRF configuration files into place. This will replace the OpenSRF configuration files that you set up while installing and testing OpenSRF; you might want to backup the old files for troubleshooting purposes. Finally, change the ownership on the installed files to the **opensrf** user:<code bash> 
-cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml 
-cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml 
-cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml 
-chown -R opensrf:opensrf /openils/</code> 
-  - As the **postgres** user on your PostgreSQL server, create the Evergreen database.  
-    - Issue the following commands on your PostgreSQL server:<code bash> 
-createdb -E UNICODE evergreen 
-createlang plperl   evergreen 
-createlang plperlu  evergreen 
-createlang plpgsql  evergreen 
-psql -f /usr/share/pgsql/contrib/tablefunc.sql evergreen 
-psql -f /usr/share/pgsql/contrib/tsearch2.sql  evergreen 
-psql -f /usr/share/pgsql/contrib/pgxml.sql     evergreen 
-psql -f /usr/share/pgsql/contrib/isn.sql       evergreen 
-</code> 
-    - As the **postgres** user on the PostgreSQL server, create a PostgreSQL user named ''evergreen'' for the database cluster:<code bash> 
-createuser -P -s evergreen 
-exit</code> 
-    - Enter the password for the new PostgreSQL superuser ("evergreen") 
-  - As the **root** user, create the database schema and configure your system with the corresponding database authentication details for the database user that you just created; on most systems, //<hostname>// will be ''localhost'' and //<port>// will be ''5432'':<code bash> 
-cd /home/opensrf/Evergreen-trunk 
-perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \ 
-       --service all --create-schema --create-bootstrap --create-offline \ 
-       --user <user> --password <password> --hostname <hostname> --port <port> \ 
-       --database <dbname> 
-</code> 
-  - As the **root** user, set up Apache:<code> 
-cd /home/opensrf/Evergreen-trunk 
-mkdir /etc/httpd/sites-available 
-cp Open-ILS/examples/apache/eg.conf       /etc/httpd/sites-available/ 
-cp Open-ILS/examples/apache/eg_vhost.conf /etc/httpd/ 
-cp Open-ILS/examples/apache/startup.pl    /etc/httpd/ 
-chmod +x /etc/httpd/startup.pl 
-rm -f /etc/httpd/conf.d/welcome.conf 
-# Now setting up SSL 
-mkdir /etc/httpd/ssl 
-cd /etc/httpd/ssl 
-# Step 7 
-openssl req -new -x509 -days 365 -nodes -out server.crt -keyout server.key 
-# Step 8 
-vi /etc/httpd/sites-available/eg.conf 
-</code> 
-  - The openssl command cuts a new SSL key for your Apache server. For a production server, you should purchase a signed SSL certificate, but we can just use a self-signed certificate and accept the warnings in the staff client and browser during testing and development: 
-  - The last code line opens ''/etc/httpd/sites-available/eg.conf'' for editing: 
-    - Search for apache2 and replace with httpd 
-    - Comment out ''Allow from 10.0.0.0/8'' and uncomment ''Allow from all'' (to enable access to the configuration CGI scripts from any workstation on any network - note that you must secure this for a production instance, preferably by locking down the allowed IP addresses and adding authentication, because you don't want just anyone adding and deleting libraries from your Evergreen instance!) 
-  - As the **root** user, edit ''/etc/httpd/conf/httpd.conf'': 
-    - Search for apache2 and replace with httpd 
-    - Replace Include conf.d/*.conf with this line: Include /etc/httpd/sites-available/eg.conf 
-    - Change ''User apache'' to ''User opensrf'' 
-    - Change ''KeepAliveTimeout'' to ''1'' 
-    - Change ''MaxKeepAliveRequests'' to ''100'' 
-    - Add the following lines to the top of the LoadModules section:<code bash> 
-LoadModule ssl_module modules/mod_ssl.so 
-LoadModule perl_module modules/mod_perl.so</code> 
-    - For **64 bit** installs **only**. Add the following lines the LoadModules section if they do not already exist:<code bash> 
-LoadModule osrf_json_gateway_module /usr/lib64/httpd/modules/osrf_json_gateway.so  
-LoadModule osrf_http_translator_module /usr/lib64/httpd/modules/osrf_http_translator.so  
-</code> 
-    - Update the prefork configuration section to suit your environment.  The following settings apply to a busy system:<code> 
-<IfModule prefork.c>  
-StartServers       20 
-MinSpareServers    5 
-MaxSpareServers   20 
-ServerLimit      256  
-MaxClients       256  
-MaxRequestsPerChild  10000 
-</IfModule></code> 
-  - As the **opensrf** user install dojo:<code bash> 
-cd /openils/var/web/js/dojo 
-wget http://download.dojotoolkit.org/release-1.3.2/dojo-release-1.3.2.tar.gz 
-tar zxf dojo-release-1.3.2.tar.gz 
-mv dojo-release-1.3.2/* . 
-rm -rf dojo-release-1.3.2*</code> 
-  - As the **root** user, change ownership of the httpd logs directory:<code bash> 
-chown opensrf /var/log/httpd</code> 
-  - As the **opensrf** user, edit ''/openils/conf/opensrf_core.xml'': 
-    - Edit ''/openils/conf/opensrf_core.xml'' to change the Jabber usernames and passwords as follows. I'm using XPath syntax on the left-hand side to indicate the position in the XML file: 
-      * ''/config/opensrf/username'' = opensrf 
-      * ''/config/opensrf/passwd'' = password for **private.localhost** opensrf user 
-      * ''/config/gateway/username'' = opensrf 
-      * ''/config/gateway/passwd'' = password for **public.localhost** opensrf user 
-      * ''/config/routers/router/transport'' - first entry, where ''transport/server'' == **public.localhost** : 
-        * ''username'' = router 
-        * ''password'' = password for **public.localhost** router user 
-      * ''/config/routers/router/transport'' - second entry, where ''transport/server'' == **private.localhost** : 
-        * ''username'' = router 
-        * ''password'' = password for **private.localhost** router user 
-    - We also need to specify the domains from which we'll accept and to which we'll make connections. If you are installing Evergreen on a single server and using the "private.localhost" / "public.localhost" domains, these will already be set to the correct values. Otherwise, search and replace to match your customized values. 
-  - Copy ''/openils/conf/srfsh.xml.example'' to ''.srfsh.xml'' in the home directory of each user you want to use to run the srfsh command line client for testing OpenSRF, and edit ''.srfsh.xml'' as follows: 
-    * ''domain'' is the router hostname (following our domain examples, ''private.localhost'' will give your srfsh access to all OpenSRF services, while ''public.localhost'' will only give you access to those OpenSRF services that are publicly exposed) 
-    * ''username'' and ''password'' must match your ''opensrf'' ejabber user for the chosen domain 
-    * ''logfile'' is the full path for a log file to which that user has write access<code xml> 
-<?xml version="1.0"?> 
-<!-- This file follows the standard bootstrap config file layout found in opensrf_core.xml --> 
-<srfsh> 
-  <router_name>router</router_name> 
-  <domain>private.localhost</domain> 
-  <username>opensrf</username> 
-  <passwd>evergreen</passwd> 
-  <port>5222</port> 
-  <logfile>/tmp/srfsh.log</logfile> 
-  <loglevel>4</loglevel> 
-</srfsh> 
-</code> 
-  - As the **opensrf** user, make the cgi-bins executable, and add an environmental variable to opensrf's ''.bashrc'' file:<code bash> 
-chmod 755 /openils/var/cgi-bin/*.cgi 
-echo "export PERL5LIB=/openils/lib/perl5:\$PERL5LIB" >> ~/.bashrc 
-. ~/.bashrc # inherit the new environment 
-</code> 
-    * Note:  in a multi-server (brick) environment, put the ~/.bashrc modifications at the top of the file, before <code>[ -z "$PS1" ] && return</code>  This will allow headless (scripted) logins to load the correct environment. 
-  - (Optional): Load translations such as Armenian (hy-AM), Canadian French (fr-CA), and others into the database to complete the translations available in the OPAC and staff client. See [[server_installation:adding_localizations|these instructions]] for details. 
- 
-=====Starting Evergreen===== 
-  - As the **root** user, start the memcached and ejabberd services (if they aren't already running):<code> 
-/etc/init.d/ejabberd start 
-/etc/init.d/memcached start 
-</code> 
-  - As the **opensrf** user, start Evergreen. The '''-l''' flag in the following command is only necessary if you want to force Evergreen to treat the hostname as '''localhost'''; if you have configured ''opensrf.xml'' using the real hostname of your machine as returned by ''perl -ENet::Domain 'print Net::Domain::hostfqdn() . "\n";''', you should not use the '''-l''' flag.<code bash> 
-osrf_ctl.sh -l -a start_all</code> 
-    * If you receive the error message **bash: osrf_ctl.sh: command not found**, then your environment variable **PATH** does not include the ''/openils/bin'' directory; this should have been set by ''.bashrc'' when you logged in as the ''opensrf'' user, based on step 19 above, but you can manually set it using the following command:<code bash>export PATH=$PATH:/openils/bin 
-</code> 
-    * If you receive the error message **Can't locate OpenSRF/System.pm in @INC ... BEGIN failed--compilation aborted**, then your environment variable **PERL5LIB** does not include the ''/openils/lib/perl5'' directory; this should have been set by ''.bashrc'' when you logged in as the ''opensrf'' user, based on step 19 above, but you can manually set it using the following command:<code bash>export PERL5LIB=$PERL5LIB:/openils/lib/perl5 
-</code> 
-  - As the **opensrf** user, generate the Web files needed by the staff client and catalogue and update the organization unit proximity (you need to do this the first time you start Evergreen, and after that each time you change the library hierarchy in ''config.cgi''):<code bash>cd /openils/bin 
-./autogen.sh -c /openils/conf/opensrf_core.xml -u</code> 
-  - As the **root** user, restart the Apache Web server:<code bash>/etc/init.d/httpd restart</code> If the Apache Web server was running when you started the OpenSRF services, you might not be able to successfully log in to the OPAC or staff client until the Apache Web server is restarted. 
- 
- 
-=====Testing connections to Evergreen===== 
-Once you have installed and started Evergreen, test your connection to Evergreen via ''srfsh'': 
-  - Start ''srfsh'' and try logging onto the Evergreen server using the default administrator user ID and password:<code> 
-/openils/bin/srfsh 
-srfsh% login admin open-ils</code> You should see a result like:<code>Received Data: "250bf1518c7527a03249858687714376" 
- 
------------------------------------- 
-Request Completed Successfully 
-Request Time in seconds: 0.045286 
------------------------------------- 
- 
-Received Data: { 
-   "ilsevent":0, 
-   "textcode":"SUCCESS", 
-   "desc":" ", 
-   "pid":21616, 
-   "stacktrace":"oils_auth.c:304", 
-   "payload":{ 
-      "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a", 
-      "authtime":420 
-   } 
- 
-} 
- 
------------------------------------- 
-Request Completed Successfully 
-Request Time in seconds: 1.336568 
-------------------------------------</code> If this does not work, it's time to do some troubleshooting. 
-    * As the **opensrf** user, run the ''settings-tester.pl'' script to see if it finds any system configuration problems. The script is found at ''Open-ILS/src/support-scripts/settings-tester.pl'' in the Evergreen source tree. If the output of ''settings-tester.pl'' does not help you find the problem, please do not make any significant changes to your configuration.  
-    * Follow the steps in the troubleshooting guide [[troubleshooting:checking_for_errors|"checking for errors"]]. 
-    * If you have followed the entire set of installation steps listed here closely, you are probably extremely close to a working system. Gather your configuration files and log files and contact the [[http://open-ils.org/listserv.php|Evergreen development mailing list]] for assistance before making any drastic changes to your system configuration. 
- 
-=====Running the staff client on Linux===== 
- 
-You can run the staff client on Linux using XULRunner. 
-  - Start up the staff client by passing the full path to the ''application.ini'' file for the source files of the local build of the Evergreen staff client. For example, if the source files for your Evergreen installation are in the ''/home/opensrf/Evergreen-trunk/'' directory, you would issue the following command:<code bash>xulrunner /home/opensrf/Evergreen-trunk/Open-ILS/xul/staff_client/build/application.ini 
-</code> 
- 
-=====Starting the Web server===== 
-Once you've started Evergreen and confirmed that a basic login attempt works, you can start up the Web server: 
-  - As the **root** user, test and start Apache. The restart command will ensure that it loads the new Evergreen modules even if Apache is already running: 
-<code>apachectl configtest && /etc/init.d/httpd restart</code> 
- 
-If there are any problems with your configuration file(s), they will be displayed.   
- 
-=====Stopping Evergreen===== 
-  - As the **opensrf** user, stop Evergreen:<code> 
-osrf_ctl.sh -l -a stop_all 
-</code> 
- 
- 
- 
-=====Setting up support for reports===== 
-Evergreen reports are extremely powerful, but some configuration is required. 
- 
-====Starting the reporter daemon==== 
-Once the ''open-ils.reporter'' process is running and enabled on the gateway, you have to start the reporter daemon. The reporter daemon periodically checks for requests for new reports or scheduled reports and gets them running.  
- 
-To start the reporter daemon, run the following command as the **opensrf** user:<code bash>clark-kent.pl --daemon</code> You can also specify other options: 
-  * sleep=//interval// : number of seconds to sleep between checks for new reports to run; defaults to 10 
-  * lockfile=//filename// : where to place the lockfile for the process; defaults to ''/tmp/reporter-LOCK'' 
-  * concurrency=//integer// : number of reporter daemon processes to run; defaults to 1 
-  * boostrap=//filename// : OpenSRF bootstrap configuration file; defaults to ''/openils/conf/opensrf_core.xml'' 
- 
-====Stopping the reporter daemon==== 
-To stop the reporter daemon, you have to kill the process and remove the lockfile. Assuming you're running just a single process and that the lockfile is in the default location, perform the following commands as the **opensrf** user:<code bash> 
-kill `ps wax | grep "Clark Kent" | grep -v grep | cut -b1-6` 
-rm /tmp/reporter-LOCK 
-</code> 
  
redhat_evergreen_trunk.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.