From d1edd4e5595ae743c39de8fbc593abda637c8187 Mon Sep 17 00:00:00 2001 From: j2blake Date: Tue, 19 Jun 2012 16:43:29 +0000 Subject: [PATCH] NIHVIVO-3721 Improve the build process for OpenSocial, including an Ant script to set up the config files. --- doc/setting_up_orng.html | 211 +++++++++++++------------------------- example.deploy.properties | 7 ++ 2 files changed, 81 insertions(+), 137 deletions(-) diff --git a/doc/setting_up_orng.html b/doc/setting_up_orng.html index 88080587..6438de25 100644 --- a/doc/setting_up_orng.html +++ b/doc/setting_up_orng.html @@ -38,136 +38,20 @@

Table of Contents

    -
  1. Create configuration files
  2. Create database tables and procedures
  3. +
  4. Create configuration directory and key file
  5. Modify Tomcat settings
  6. -
  7. Deploy the web application
  8. Configure VIVO
  9. +
  10. Run the deployment script
  11. Does it work?

-

I. Create configuration files

-

- In your VIVO home directory, create a directory called shindig. - Under that, create directories called conf and openssl. - Your VIVO home directory will look something like this: -

     [VIVO home directory]
-      |
-      |--shindig
-      |   |
-      |   |--conf
-      |   |
-      |   |--openssl
-      |
-      |--solr
-      |
-      |--uploads
-

-

A. Create a secure key file

-

- Shindig uses an encryption key to insure that the communication - between the gadget and the server is secure. - You should create a file that contains the encryption key, - and store that file in the shindig/openssl directory that you created. -

-

- On Unix-based systems (like Linux or Mac OS X), this command will create - an encryption key from a random seed: -

dd if=/dev/random bs=32 count=1 | openssl base64 > [key-file]
- For example, if your VIVO home directory is /usr/local/vivo/data, - you might use the command this way: -
dd if=/dev/random bs=32 count=1 | openssl base64 > /usr/local/vivo/data/shindig/openssl/securitytokenkey.txt
-

-

- If your VIVO installation is installed on a machine that runs Microsoft Windows, - you will need to find another way to create an encryption key. - The easiest way might be to find a Unix-based machine, - issue the command above, and copy the resulting file to your Windows machine. -

- -

B. Create the Create configuration files

-

- In your VIVO distribution directory, find the file called -

vitro-core/opensocial/shindig.orng.properties
and copy it to the - shindig/conf directory that you created. -

-

- Set these values in the shindig.orng.properties file -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Property Name - - Example Value -
- Specify the location of the encryption key file. -
- shindig.signing.key-file - - /usr/local/vivo/data/shindig/openssl/securitytokenkey.txt -
- Specify the JDBC URL of your database. Change - the end of the URL to reflect your database name (if it is not "vivo"). -
- orng.dbURL - - jdbc:mysql://localhost/vivo -
- Change the username to match the authorized user - you created in MySQL when installing VIVO. -
- orng.dbUser - - username -
- Change the password to match the password you - created in MySQL when installing VIVO. -
- orng.dbPassword - - password -
- -

II. Create database tables and procedures

+

I. Create database tables and procedures

Shindig uses several database tables in MySQL to store its data: - which gadgets appear on which pages, what size are the gadgets, + which gadgets appear on which pages, how large are the gadgets, what information applies to each individual, and more. Shindig also creates stored procedures in MySQL. These are small pieces of code that simplify the use of the database tables. @@ -201,6 +85,45 @@ process the file.

+

II. Create configuration directory and key file

+

+ In your VIVO home directory, create a directory called shindig. + Under that, create directories called conf and openssl. + Your VIVO home directory will look something like this: +

     [VIVO home directory]
+      |
+      |--shindig
+      |   |
+      |   |--conf
+      |   |
+      |   |--openssl
+      |
+      |--solr
+      |
+      |--uploads
+

+ +

+ Shindig uses an encryption key to insure that the communication + between the gadget and the server is secure. + You should create a file that contains the encryption key, + and store that file in the shindig/openssl directory that you created. +

+

+ On Unix-based systems (like Linux or Mac OS X), this command will create + an encryption key from a random seed: +

dd if=/dev/random bs=32 count=1 | openssl base64 > [key-file]
+ For example, if your VIVO home directory is /usr/local/vivo/data, + you might use the command this way: +
dd if=/dev/random bs=32 count=1 | openssl base64 > /usr/local/vivo/data/shindig/openssl/securitytokenkey.txt
+

+

+ If your VIVO installation is installed on a machine that runs Microsoft Windows, + you will need to find another way to create an encryption key. + The easiest way might be to find a Unix-based machine, + issue the command above, and copy the resulting file to your Windows machine. +

+

III. Modify Tomcat settings

The Shindig application must know where to find the configuration file that you created in @@ -226,16 +149,7 @@ export CATALINA_OPTS='-Dshindig.host=localhost -Dshindig.port=8080' export CATALINA_OPTS='-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.headless=true -Xms1024m -Xmx1024m -XX:MaxPermSize=128m'

-

IV. Deploy the web application

-

- In the VIVO distribution directory, a file called vitro-core/opensocial/shindigorng.war - contains the ORNG-Shindig web application. - Copy this file to the webapps directory of your Tomcat server. - For example, if your Tomcat server is located at /usr/local/tomcat, - then you should copy this file to /usr/local/tomcat/webapps/shindigorng.war -

- -

V. Configure VIVO

+

IV. Configure VIVO

In the VIVO distribution directory, the file called deploy.properties contains configuration options for the VIVO application. @@ -265,7 +179,7 @@ export CATALINA_OPTS='-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.he The host name and port number of the Token Service that ORNG shindig creates. - For now, a value of localhost or 127.0.0.1 will not work. + Note that a value of localhost or 127.0.0.1 will not work. You must provide the actual host name of your machine, followed by :8777 @@ -273,9 +187,29 @@ export CATALINA_OPTS='-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.he OpenSocial.tokenService myhost.mydomain.edu:8777 + + + The path to a key file that will be used to generate security tokens. This is the + file that was created in Step I of this process. + + + + OpenSocial.tokenKeyFile + /usr/local/vivo/data/shindig/openssl/securitytokenkey.txt + +

V. Run the deployment script

+

+ At the command line, from the top level of the VIVO distribution + directory, type: +

+
                ant orng
+

+ to configure the ORNG Shindig application and deploy it to Tomcat's webapps directory. +

+

VI. Does it work?

Start VIVO. Enter a search term in the search box, and view the results. Check the gadgets there. @@ -341,20 +275,23 @@ export CATALINA_OPTS='-Dshindig.host=localhost -Dshindig.port=8080 -Djava.awt.he

diff --git a/example.deploy.properties b/example.deploy.properties index ea4db6a0..488c1d8f 100644 --- a/example.deploy.properties +++ b/example.deploy.properties @@ -198,6 +198,13 @@ proxy.eligibleTypeList = http://xmlns.com/foaf/0.1/Person, http://xmlns.com/foaf # #OpenSocial.tokenService = myhost.mydomain.edu:8777 +# +# For OpenSocial integration +# The path to the key file that will be used qwhen generating security tokens for VIVO and +# shindig to share. +# +#OpenSocial.tokenKeyFile = /usr/local/vivo/data/shindig/openssl/securitytokenkey.txt + # # For OpenSocial integration # Only set sandbox to True for dev/test environments. Comment out or set to False in production