Difference between revisions of "Installation"
m |
|||
Line 24: | Line 24: | ||
gem install rails --include dependencies | gem install rails --include dependencies | ||
− | + | ||
More information on installing Rails may be found at the URL above. | More information on installing Rails may be found at the URL above. | ||
We have developed primarily on Rails version 1.1.12, and production is now using 1.1.16. For security reasons you should be using 1.1.16 or higher. | We have developed primarily on Rails version 1.1.12, and production is now using 1.1.16. For security reasons you should be using 1.1.16 or higher. | ||
Line 32: | Line 32: | ||
gem install redcloth | gem install redcloth | ||
− | === ImageMagik (http://www.imagemagick.org/script/index.php) === | + | === ImageMagik (optional) (http://www.imagemagick.org/script/index.php) === |
* NOTE: This is optional, and not required for MorphBank images. | * NOTE: This is optional, and not required for MorphBank images. | ||
Line 62: | Line 62: | ||
* You need to be running Ruby version 1.8.2 or higher (tested on 1.8.2) | * You need to be running Ruby version 1.8.2 or higher (tested on 1.8.2) | ||
− | * OS X updates **WILL** break your installation by (re)installing Ruby to /usr/bin. Their version (at least in 10.3.9) is incompatible with mx. The easiest way to get around this is to simply rename the OS X version ruby in usr/local/bin to something like ruby_old like this: | + | * OS X updates **WILL** break your installation by (re)installing Ruby to /usr/bin. Their version (at least in 10.3.9) is incompatible with mx. The easiest way to get around this is to simply rename the OS X version ruby in /usr/local/bin to something like ruby_old like this: |
− | + | ||
+ | cd /usr/local/bin | ||
mv ruby ruby_old | mv ruby ruby_old | ||
− | |||
* Test your version of ruby at the path by entering | * Test your version of ruby at the path by entering | ||
Line 123: | Line 123: | ||
use database mx_development; | use database mx_development; | ||
− | insert into people (first_name, last_name, login, password, is_admin, creates_projects) values ('joe', 'smith', 'jsmith', sha1('foosomepwdbar'), 1,1); | + | insert into people (first_name, last_name, login, password, is_admin, |
+ | creates_projects) values ('joe', 'smith', 'jsmith', sha1('foosomepwdbar'), 1,1); | ||
− | |||
* IMPORTANT - you must wrap 'foo' and 'bar' around your password in the above line. In the example above the password for 'jsmith' is 'somepwd' # | * IMPORTANT - you must wrap 'foo' and 'bar' around your password in the above line. In the example above the password for 'jsmith' is 'somepwd' # | ||
Line 143: | Line 143: | ||
You should see a login page. If you see the mx page but no login fields then you have not correctly added your administrator user. | You should see a login page. If you see the mx page but no login fields then you have not correctly added your administrator user. | ||
+ | |||
Once logged in navigate to | Once logged in navigate to | ||
Revision as of 20:44, 16 January 2007
Installing mx
These are somewhat brief and should evolve as more people attempt to install. Feel free to add questions right here.
Required Software
MySQL (http://www.mysql.com/)
- You need at least MySQL 4.1.14 to install the tables. 4.1.10 and previous will load, but several queries (mostly Matrix related) will not work. We have not investigated whether they can be modified to work with 4.1.10 or earlier. MySQL 5.n is in use on development and production servers.
- There are many examples of how to install and secure MySQL on your machine available on whe world-wide web. If you are using OS X chances are you have a copy installed already (it will need configuration if you haven't already done so).
Ruby (http://wiki.rubygarden.org/Ruby/page/show/HomePage)
- If you don't already have ruby you can find more about it here: http://wiki.rubygarden.org/Ruby/page/show/HomePage. mx has been be run under 1.82 or 1.84. We recommend building it from source.
RubyGems (http://rubygems.org/read/chapter/3)
Its easiest to install several Ruby packages (including Rails) through the Ruby package manager RubyGems.
Rails (http://www.rubyonrails.org/)
Install Rails with
gem install rails --include dependencies
More information on installing Rails may be found at the URL above. We have developed primarily on Rails version 1.1.12, and production is now using 1.1.16. For security reasons you should be using 1.1.16 or higher.
You'll also need RedCloth, a simple markup language that is used in various places.
gem install redcloth
ImageMagik (optional) (http://www.imagemagick.org/script/index.php)
- NOTE: This is optional, and not required for MorphBank images.
- mx uses ImageMagik to handle images. At present it is set to do this through a PHP call (due to the drastic speed increase this provides).
- See the image.rb model to eliminate the need for PHP.
- The tool 'convert' must be in your PATH, and in the default setting so must PHP, i.e. when you type 'convert' or 'php' at the command prompt you should get a short status line indicating they executed.
Files and images uploaded to mx are stored in /public/files
If you are on a PC create the following folders in /public
files files/big files/medium files/original files/thumb
On a *nix system you'll need the same structure, but note that you can also use a symbolic link to keep your images elsewhere.
Platform Specific Notes
OS X
- You may have to use 'sudo' in front of your commands when installing, like
sudo gem install rails --include dependencies
- You should have [Apple's develop tools installed before installing mx. You'll need a login to get them if you don't already have them on disk.
- You need to be running Ruby version 1.8.2 or higher (tested on 1.8.2)
- OS X updates **WILL** break your installation by (re)installing Ruby to /usr/bin. Their version (at least in 10.3.9) is incompatible with mx. The easiest way to get around this is to simply rename the OS X version ruby in /usr/local/bin to something like ruby_old like this:
cd /usr/local/bin mv ruby ruby_old
- Test your version of ruby at the path by entering
ruby -v
x86 (Windows 2000/XP)
- The db/rake tasks for rebuilding are apparently borked at present matt 19:40, 16 January 2007 (CST)
*nix Specific Notes
Installation
The basic steps are:
1) Install the required software (see above). 2) Download the mx source. 3) Build the database(s). 4) Configure the database for startup.
Detailed installation steps:
2) Download mx source
If you're reading this you likely already have the source. If not, download and unpack the source from mx-database.sourceforge.net, or check out a copy from SVN, also at Sourceforge [coming soon].
3) Build the database
The easiest way to install the database is to open a terminal or command prompt and navigate to the /db folder at the root of the mx code (you should see the tables.sql file there). Once there logon to mysql as an administrator. The process to install from scratch will look like something like this (don't forget the ';' for mysql commands):
mysql -u root -p <enter password> create database mx_developement; use mx_development; source tables.sql;
Build the production databases the same way:
create database mx_production; use database mx_production; source tables.sql;
4) Add an administrator to the mx tables
These steps all require that you are using the MySQL client
mysql -u root -p <enter password>
You'll need to add a MySQL account so that the app can access the database:
'GRANT ALL PRIVILEGES ON mx_development.* TO 'mx'@'localhost' IDENTIFIED BY 'MmmXxx';
A single user with administrator privileges will have to be manually added to the 'people' tables prior to using mx. Once this user is added additional users can be added from the mx interface.
use database mx_development; insert into people (first_name, last_name, login, password, is_admin, creates_projects) values ('joe', 'smith', 'jsmith', sha1('foosomepwdbar'), 1,1);
- IMPORTANT - you must wrap 'foo' and 'bar' around your password in the above line. In the example above the password for 'jsmith' is 'somepwd' #
While in the MySQL client you'll also want to add a root node to your taxonomic names hierarchy (assumes the admin you created has id 1).
insert into taxon_names (name, l, r, creator_id, updator_id) values ('root', 1, 2, 1, 1);
Usage (development mode)
To test/develop in development mode navigate to the root of your installation and type
ruby script/server
Open a web browser and browse to
127.0.0.1:3000
You should see a login page. If you see the mx page but no login fields then you have not correctly added your administrator user.
Once logged in navigate to
127.0.0.1:3000/admin
to create new projects.
You can also navigate to
127.0.0.1:3000/account/signup
to add regular users.
Usage (production mode)
<under construction>
Production installation follows, for the most part, the same installation process as above. See the Rails homepage for setting up the server. Note that only users with accounts can see data in a clean installation of mx, i.e. you must manually configure the installation to make data available to the public.