oor-dev
[Top] [All Lists]

Re: [oor-dev] BioPortal 2.0 Install help

To: OpenOntologyRepository-development <oor-dev@xxxxxxxxxxxxxxxx>
From: Tejas Parikh <tejas@xxxxxxxxxxxxxxx>
Date: Thu, 10 Dec 2009 09:31:14 -0500
Message-id: <63274c480912100631x2264112fu2041617c80f0170d@xxxxxxxxxxxxxx>
Paul,

There are few errors I found in the bioportal install instructions.

1)

protege.jdbc.urljdbc:mysql://localhost/bioportal

should be

protege.jdbc.urljdbc:mysql://localhost/bioportal_protege

because the metadata table is created in bioportal_protege and bioportal cannot find the table and the server ends  up in 500 internal error.

2)

Instruction to install rails are mentioned twice. First it says

gem install rails
 and later on
gem install rails -v 2.0.2

Does BioPortal need a specific version of rails? This step can get confusing.

Thanks,
--Tejas


On Fri, Dec 4, 2009 at 6:32 PM, Paul R Alexander <palexander@xxxxxxxxxxxx> wrote:
Here are the updated instructions:

How to install Bioportal

Contents

[hide]

Prerequisities

  • Install Sun Java 1.5 or higher (On ubuntu you may need to make it the default jre: sudo update-alternatives --config java)
  • Install tomcat
    • On ubuntu, it will run on port 8180 - this will create problems with the BP UI (which assumes 8080 and 80), solution in the UI section below
      • The BioPortal core port can now be configured in the environment.rb file of the Rails app. --Paul 14:27, 23 October 2009 (PDT)
    • sudo apt-get install tomcat5.5
  • Install MySQL (5.1)
    • sudo apt-get install mysql-server

Install BP backend

  • In MySQL, create databases:
    • mysql -u root -p
    • create database bioportal;
    • create database bioportal_protege;
    • create database bioportal_lexgrid;
  • Add user: bioportal_prd/bioportal_prd (change password, if you want, but make sure you keep it in sync with the build.properties)
    • create user bioportal_prd identified by 'bioportal_prd'
  • grant all rights to bioportal_prd on the 3 databases
    • grant all on *.* to 'bioportal_prd'@'localhost'
  • on the bioportal database, grant also the SUPER and the TRIGGER rights
    • grant SUPER, TRIGGER on *.* to 'bioportal_prd'@'localhost'
  • create user ncboadmin; (needed!)
    • create user ncboadmin identified by 'ncboadmin'
  • Create some directory on your computer to hold the bioportal resources, e.g.: /work/tools/bioportal/resources
  • Edit the build.properties from the bioportal_core folder, especially:
bioportal.resource.path/work/tools/bioportal/resources
appserver.home/usr/share/tomcat5.5
bioportal.jdbc.urljdbc:mysql://localhost:3306/bioportal
bioportal.jdbc.drivercom.mysql.jdbc.Driver
bioportal.jdbc.usernamebioportal_prd
bioportal.jdbc.passwordbioportal_prd

protege.jdbc.urljdbc:mysql://localhost/bioportal
protege.jdbc.drivercom.mysql.jdbc.Driver
protege.jdbc.usernamebioportal_prd
protege.jdbc.passwordbioportal_prd

lexgrid.db.urljdbc:mysql://localhost/bioportal_lexgrid
lexgrid.db.userbioportal_prd
lexgrid.db.passwordbioportal_prd

lexgrid.email.totudorache@xxxxxxxxxxxx
  • Execute:
    • mysql -u root -p < db/sql/bioportal_db.sql
    • mysql -u root -p < db/sql/bioportal_lookup_data.sql
    • mysql -u root -p < db/sql/bioportal_metadata_base_inclBPcategories.sql
  • Make following steps only if you are using tag 1018
    • mysql -u root -p < db/sql/bioportal_db_changes_1017.sql
    • mysql
    • use bioportal;
    • alter table ncbo_usage_log modify request_parameters varchar(2048);
  • Execute:
    • sudo ant clean deploywar

This should create a war file that is deployed in your tomcat folder. You might get a permission exception, in which case, you either run as root, or give your user write access to tomcat/webapps.

Troubleshooting

  • If you get in catalina.out a access security exception (something like could not parse default web.xml), then edit CATALINA_HOME/conf/policy.d/01system.policy
//Added by Tania to make BP run, not a good idea to grant to all, all permisson... well, it's a hack
grant {
     permission java.security.AllPermission;
};

(I had problems with the file permission in tomcat, so I have given all write permission to webapps. Not recommended, but solved many problems. Alex can tell you how to do it right)

  • Always look in the tomcat logs: catalina.out and bioportal.log

Install BioPortal UI Development Environment

  • Install ruby, rubygems, rails: http://rubyonrails.org/download
    • sudo apt-get install ruby
    • sudo apt-get install rubygems
    • sudo apt-get install rails
    • gem install rails
  • Install MySQL
    • sudo gem install mysql -- --with-mysql-dir/usr/share/mysql
      • if you get error "'require': no such file to load -- mkmf (LoadError)", you need to install:
        • sudo apt-get install libmysqlclient15-dev
        • sudo apt-get install ruby-dev
  • Install memcached
    • sudo apt-get install memcached
  • Install ruby gems
    • gem install rails -v 2.0.2
    • gem install fastthread
    • gem install memcache-client
    • gem install SystemTimer
  • Install LibXML and related gem
    • sudo apt-get install libxml2 libxml2-dev
    • gem install libxml-ruby
  • Go to the checked out code and edit config/database.yml and edit the database connection for "development". E.g.:
development:
 adapter: mysql
 encoding: utf8
 database: BioPortalGui_development
 username: bioportal_prd
 password: bioportal_prd
 host: localhost
  • In MySql give all permission on BioPortalGui_development to the bioportal user that you have set up in the backend (e.g., bioportal_prd)
  • Run the database rake task from the root of the BioPortal UI directory:
    • rake db:migrate
  • Modify config/environments/production.rb file to point to the correct location of your memcache server
  • Rename /config/environment.rb.sample to /config/environment.rb and modify the following:
    • Point to the correct SMTP server
    • Point to the proper BioPortal Core and Open Biomedical Services Resource Index rest URLs (no trailing slashes)
    • Provide the port number of your BioPortal Core Tomcat installation
    • Enable and configure reCAPTCHA if desired
    • If tomcat runs on a different port (e.g., 8180), like in ubuntu, change the $REST_PORT setting in config/environment.rb
  • Start the webserver
    • Webrick or Mongrel are Ruby-based webservers, which can be started from the BioPortal UI directory:
      • ruby script/server
      • Webrick and Mongrel default to port 3000
    • Alternatively, you can use Phusion Passenger (aka mod_rails, mod_rack). This is recommended for production environments. More information: http://www.modrails.com
  • UI should be up now. Make sure backend in Tomcat is running. To test UI go to:
  • If search is not working, make the tomcat/logs/bioportal.log writable to everybody

Troubleshooting

If something goes wrong, then look in:

  • Webrick console
  • Tomcat logs: catalina.out and bioportal.log

Install the bioportal admin application (optional)

  • This is optional, and only if you want to do things directly on the backend (e.g. start parsing, indexing, deleting ontologies, etc.)
  • Checkout the bioportal admin from SVN

svn co https://bmir-gforge.stanford.edu/svn/bioportal_admin/trunk bioportal_admin

cd bioportal_admin

  • make a copy of the build.properties.sample and rename it to build.properties
  • edit the build.properties (entries similar to the ones in build.properties for bioportal_core, see above)
  • you'll have to edit bioportal.admin.encryption.key . See comments for valid values
  • run the build:

ant clean deplywar

  • try it out on:

http://localhost:8180/bioportal_admin (your port might be different)



What to do next

  • Go get a coffee; if you succeeded, then you deserve it :)
  • Create a user from the Bioportal UI
  • Try to upload a small ontology
  • If you want to use the bioportal_admin, you will have to give your user admin privileges. You can do this, by first looking into the

bioportal databse, ncbo.l.role table, what is the id for ROLE_ADMINISTRATOR (e.g., 2824). Then, look in the ncbo_user table for your user (firstname and lastname col), and write down the user id from the id column (e.g. 38312). Then go to ncbo_user_role table and edit the row that contains your user id in the user_id column, and put in the role_id column the administrator role id. E.g. (user_id:38312,role_id:2824). Restart the backend and try to log into the bioportal_admin



On 12/4/09 3:24 PM, Tejas Parikh wrote:
Paul,

Can you please point me to updated instruction on wiki. I have the instructions in an email and do not have link to the wiki.

Thanks,
--Tejas


On Fri, Dec 4, 2009 at 5:40 PM, Paul R Alexander <palexander@xxxxxxxxxxxx> wrote:
Tejas,

That particular schema file was provided as a workaround. The preferred way to get the MySQL schema in place is to run 'rake db:migrate' from the BioPortal UI directory. I've updated the instructions on the wiki for this and some other requirements that weren't included, so please check the new instructions and try again. Also, you may need to update your code from the trunk in order for the rake task to run properly.

Let me know if you have any other problems.

Thanks,
Paul


On 12/3/09 4:29 PM, Tejas Parikh wrote:
Hi,

I am trying to execute following step in installing BioPoratal 2.0

- Run the database script for creating the MySQL UI tables
mysql -uroot -p < BioportalSchema.sql

However I cannot find the sql script "BioportalSchema.sql" in the db directory of bioportal_core or in the bioportalui. Where do i get this script from?

Thanks
--Tejas
_________________________________________________________________ Message Archives: http://ontolog.cim3.net/forum/oor-dev/ Config/Unsubscribe: http://ontolog.cim3.net/mailman/listinfo/oor-dev/ Shared Files: http://ontolog.cim3.net/file/work/OOR/dev/ Wiki: http://ontolog.cim3.net/cgi-bin/wiki.pl?OpenOntologyRepository


_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/oor-dev/
Config/Unsubscribe: http://ontolog.cim3.net/mailman/listinfo/oor-dev/
Shared Files: http://ontolog.cim3.net/file/work/OOR/dev/
Wiki: http://ontolog.cim3.net/cgi-bin/wiki.pl?OpenOntologyRepository


_________________________________________________________________ Message Archives: http://ontolog.cim3.net/forum/oor-dev/ Config/Unsubscribe: http://ontolog.cim3.net/mailman/listinfo/oor-dev/ Shared Files: http://ontolog.cim3.net/file/work/OOR/dev/ Wiki: http://ontolog.cim3.net/cgi-bin/wiki.pl?OpenOntologyRepository


_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/oor-dev/
Config/Unsubscribe: http://ontolog.cim3.net/mailman/listinfo/oor-dev/
Shared Files: http://ontolog.cim3.net/file/work/OOR/dev/
Wiki: http://ontolog.cim3.net/cgi-bin/wiki.pl?OpenOntologyRepository



_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/oor-dev/   
Config/Unsubscribe: http://ontolog.cim3.net/mailman/listinfo/oor-dev/   
Shared Files: http://ontolog.cim3.net/file/work/OOR/dev/ 
Wiki: http://ontolog.cim3.net/cgi-bin/wiki.pl?OpenOntologyRepository     (01)
<Prev in Thread] Current Thread [Next in Thread>