OERca install

OERca install = Installing OERca =

If you encounter bugs when using the system, or if you have questions about functionality, send them to oerca-support@umich.edu.

System Requirements
It runs on several *NIX-like operating systems. We have not run it on a Windows platform. (There may be assumptions in the code that prevent it from running on Windows.) We have successfully run it on:


 * Ubuntu 8.10, 9.04, 9.10
 * MacOS 10.4, 10.5, 10.6 (this is only for development. 10.6.x/Snow Leopard requires some tweaks)
 * RedHat Enterprise Linux 5.3, 5.4
 * CentOS 5.3, 5.4

Below are specific software requirements/assumptions:


 * Apache 2.x web server with at least the following modules
 * mime
 * php5
 * rewrite
 * ssl (to prevent login information being sent in cleartext)
 * cosign (OPTIONAL, see below)


 * PHP 5.1.x or later (There is a problem with zip files in certain builds of PHP 5.2.8)
 * MySQL 5.0.x or later (We have used version 5.0.x and 5.1.x)
 * python 2.4 or 2.5 (used for "Document Decomposition")
 * java 1.5 or 1.6 (used for "Document Decomposition")
 * Cosign 3.0 (for user authentication -- OPTIONAL, see below)
 * subversion 1.4 or greater (to retrieve and update the OERca source)

Additionally, "Document Decomposition" requires these programs:


 * pdfinfo (available in package poppler-utils)
 * pdfimages (available in package poppler-utils)
 * pnmtopng (available in package netpbm)
 * convert (available in package imagemagick)
 * gs (available in package ghostscript)

The OpenOffice Decomposition/Recomposition requires that OpenOffice is installed. We have the following RPMs installed from the "Optional Productivity Apps" channel of Redhat Enterprise Linux:


 * openoffice.org-calc-3.1.1-19.5.el5_5.1
 * openoffice.org-sdk-3.1.1-19.5.el5_5.1
 * openoffice.org-ure-3.1.1-19.5.el5_5.1
 * openoffice.org-headless-3.1.1-19.5.el5_5.1
 * openoffice.org-impress-3.1.1-19.5.el5_5.1
 * openoffice.org-core-3.1.1-19.5.el5_5.1
 * openoffice.org-writer-3.1.1-19.5.el5_5.1
 * openoffice.org-graphicfilter-3.1.1-19.5.el5_5.1
 * openoffice.org-draw-3.1.1-19.5.el5_5.1
 * openoffice.org-base-3.1.1-19.5.el5_5.1

Getting the Application Code
The source code is publicly available via the Sakai project Subversion repository. The examples below assume the code will be checked out at into the location /var/webapps/oerca, but you may choose your own location.

svn co https://source.sakaiproject.org/contrib/ocw2/branches/version-1.0 &lt;your destination directory&gt;

i.e. svn co https://source.sakaiproject.org/contrib/ocw2/branches/version-1.0 /var/webapps/oerca This is a stable branch of the OERca code. There may occasionally be updates, which can be retrieved by doing svn up The tool sub-directory is the "top" of the application. Create a symlink from your Apache htdocs directory to the OERca application: ln -s /var/webapps/oerca/tool /var/www/oerca

Configuring the Application

 * 1) Create a MySQL database. You can use any name for the database. The examples below will assume the name oercadb. For example: % mysql -u root -p

Enter password: mysql&gt; CREATE DATABASE oercadb; mysql&gt; \quit %

Optionally, create a dedicated mysql user and password for the OERca database: % mysql -u root -p Enter password: mysql&gt; GRANT ALL ON oercadb.* TO 'oerca_user@localhost' IDENTIFIED BY 'xyz123ccc'; mysql&gt; \quit %
 * 1) Create the initial table structure and add an initial administrator user to the database. First edit file /var/webapps/oerca/schema/create_initial_admin.sql replacing NAME, USER_NAME, and EMAIL in the INSERT command with appropriate values for your environment. Then execute the mysql commands to create the tables and the initial admin user. % mysql -u root -p

Enter password: mysql&gt; use oercadb Database changed mysql&gt; source /var/webapps/oerca/schema/oerca_schema.sql mysql&gt; source /var/webapps/oerca/schema/create_initial_admin.sql mysql&gt; source /var/webapps/oerca/schema/create_initial_mimetypes.sql mysql&gt; source /var/webapps/oerca/schema/create_initial_object_types.sql mysql&gt; source /var/webapps/oerca/schema/create_initial_object_subtypes.sql mysql&gt; source /var/webapps/oerca/schema/create_initial_tags.sql mysql&gt; \quit %


 * 1) Copy template configuration files: % cd /var/webapps/oerca/tool/system/application/config

% cp autoload.template autoload.php % cp config.template config.php % cp constants.template constants.php % cp database.template database.php % cp email.template email.php % cp freakauth_light.template freakauth_light.php % cp hooks.template hooks.php % cp layout.template layout.php % cp mimes.template mimes.php % cp routes.template routes.php % cp smileys.template smileys.php % cp user_agents.template user_agents.php


 * 1) Edit the config.php and layout.php files, replacing all instances of @OERTOP@ with the root of your application. For example, in layout.php: $config['app_uploads_path'] = $_SERVER['DOCUMENT_ROOT'].'/@OERTOP@/uploads/';

might become $config['app_uploads_path'] = $_SERVER['DOCUMENT_ROOT'].'/oerca/uploads/';
 * 1) Edit email.php replacing some.mail.server.you.can.use.com</tt> with the name of an smtp host that can be used to send notification email messages. For example: $config['smtp_host'] = 'some.mail.server.you.can.use.com';

might become $config['smtp_host'] = 'mail-relay.umich.edu';
 * 1) Edit database.php replacing the username</tt>, password</tt>, database</tt>, and dbprefix</tt> entries with values appropriate for your database environment. For example, $db['default']['username'] = "some_useful_db_user";

$db['default']['password'] = "some_secret_password"; $db['default']['database'] = "some_useful_database_name"; $db['default']['dbprefix'] = "some_useful_prefix";

might become $db['default']['username'] = "oerca_user"; $db['default']['password'] = "xyz123ccc"; $db['default']['database'] = "oercadb"; $db['default']['dbprefix'] = "ocw_";
 * 1) Copy the .htaccess template file: % cd /var/webapps/oerca/tool

% cp dot.htaccess-template .htaccess

And replace @OERTOP@</tt> in .htaccess</tt> with the root of your application. For example: RewriteRule ^(.*)$ /@OERTOP@/index.php/$1 [L] might become RewriteRule ^(.*)$ /oerca/index.php/$1 [L]
 * 1) NOTE: This step assumes that you are using Cosign for authentication. If you are not using Cosign, or some other web authentication method which sets $_SYSTEM['REMOTE_USER']</tt>, ignore this step and continue to the next step.

Full configuration details for Apache and the Cosign module is beyond the scope of this document. However, here is an abbreviated (and modified) example from our development machine. In this example, some Cosign parameters are configured globally. The default is no Cosign authentication required ("CosignProtected Off"). For the OERca application directory, Cosign authentication is required ("CosignProtected On"). NameVirtualHost *:443 &lt;VirtualHost *:443&gt; ServerAdmin user@umich.edu

SSLEngine on       SSLCertificateFile /usr/local/etc/apache/certs/devmachine-test.pem ServerName devmachine.umms.med.umich.edu

CosignProtected        Off CosignHostname         weblogin.umich.edu CosignRedirect         https://weblogin.umich.edu/ CosignPostErrorRedirect https://weblogin.umich.edu/cosign/post_error.html CosignValidReference   ^https?:\/\/.*\.umich\.edu(\/.*)? CosignValidationErrorRedirect  http://weblogin.umich.edu/cosign/validation_error.html CosignCheckIP          never CosignCrypto /usr/local/etc/apache/certs/devmachine-test.key /usr/local/etc/apache/certs/devmachine-test.pem /usr/local/etc/apache/certs &lt;Location /cosign/valid&gt; SetHandler     cosign CosignProtected Off Allow from all Satisfy any &lt;/Location&gt;

&lt;Directory /var/www/oerca/&gt; Options -Indexes FollowSymLinks MultiViews # AllowOverride None AllowOverride All SSLRequireSSL Order allow,deny allow from all CosignProtected On                CosignService    devmachine.umms.med &lt;/Directory&gt; &lt;/VirtualHost&gt;
 * 1) NOTE: This step assumes that you are not using Cosign for authentication. If you are using Cosign, or some other web authentication method which sets $_SYSTEM['REMOTE_USER']</tt>, ignore this step and continue to the next step.

If you are not using Cosign, there are several files which must be replaced with "non-Cosign" versions. (Optionally, you may want to save the original versions before replacing them!) % cd /var/webapps/oerca/tool/system/application/ % cp controllers/NoCosign/auth.php controllers/auth.php % cp libraries/NoCosign/FAL_front.php libraries/FAL_front.php % cp libraries/NoCosign/FAL_validation.php libraries/FAL_validation.php % cp libraries/NoCosign/Freakauth_light.php libraries/Freakauth_light.php Full configuration details for Apache is beyond the scope of this document. However, here is an abbreviated (and modified) example from our development machine. NameVirtualHost *:443 &lt;VirtualHost *:443&gt; ServerAdmin user@umich.edu

SSLEngine on       SSLCertificateFile /usr/local/etc/apache/certs/devmachine-test.pem ServerName devmachine.umms.med.umich.edu

&lt;Directory /var/www/oerca/&gt; Options -Indexes FollowSymLinks MultiViews # AllowOverride None AllowOverride All SSLRequireSSL Order allow,deny allow from all &lt;/Directory&gt; &lt;/VirtualHost&gt;
 * 1) At this point, you should be ready to re-start the web server and access the application.