Project

General

Profile

Myami on Ubuntu » History » Version 27

Jim Pulokas, 08/30/2012 02:13 PM

1 26 Jim Pulokas
*_WARNING:  This is a preliminary document.  Use at your own risk!_*
2
3 1 Jim Pulokas
h1. myami on Ubuntu
4
5 24 Jim Pulokas
This is mainly a log of various experiences installing myami on Ubuntu which will gradually evolve into a more formal document.  This will attempt to demonstrate the installation of all of myami including both leginon and appion on a single Ubuntu host.  This will also include running MySQL, Apache Torque, etc. on this local host without needing to connect to any other host.
6 1 Jim Pulokas
7 3 Jim Pulokas
h2. Installing a basic Ubuntu system
8 1 Jim Pulokas
9
We use Ubuntu 12.04 LTS (Precise) Desktop 64 bit.  Install a basic system from an image on CD or bootable USB drive. Default selections during the install process, no 3rd party repositories, no network configuration and no updates during the installation.  This makes it easier in the remainder of this document to know that we have started from a known base system.  Reboot.
10
11
Following the initial reboot:
12 4 Jim Pulokas
* connect to the internet (click network icon in upper right)
13 3 Jim Pulokas
* update packages:<pre>sudo apt-get update
14
sudo apt-get upgrade</pre>
15 1 Jim Pulokas
* Reboot
16 3 Jim Pulokas
17
You now have a basic up-to-date Ubuntu system
18
19 18 Jim Pulokas
h2. Installing additional packages required by myami
20
21
There are many additional packages to install, but we can try to condense that list to the smallest set necessary to pass to the update command which will then figure out all the other dependencies.
22
23
Here is a single command to install all the necessary packages:<pre>sudo apt-get install subversion vim python-MySQLdb python-wxgtk2.8 python-fs mysql-server php5 php5-mysql libssh2-php php5-gd</pre>During installation, you will be prompted several times to create a mysql root password.  This can optionally be left blank at the expense of less security.  Note:  installing the vim text editor is my own preference... use an inferior text editor if you wish :)
24
25
The Scipy package is also required, but the current version 0.9.0 that comes with Ubuntu 12.04 is broken.  You need to grab the more recent version of Scipy from Ubuntu Quantal (development version).  To make a clean installation that will not confuse the package manager we have prepared a mini-repository that includes this new scipy.  You can download and install scipy using the following set of commands copied into your terminal.<pre>sudo mkdir /usr/local/share/myami</pre>That should get your password in the sudo cache so you can copy the rest of these without entering a password:<pre>cd /usr/local/share/myami
26
sudo wget http://emg.nysbc.org/attachments/download/1488/ubuntu-scipy-0.10.1.tar.bz
27
sudo tar jxf ubuntu-scipy-0.10.1.tar.bz
28
sudo sh -c 'echo "deb file:///usr/local/share/myami/ubuntu-scipy-0.10.1 ./" > /etc/apt/sources.list.d/myami.list'
29
sudo apt-get update
30
sudo apt-get install python-scipy</pre>Make sure that last line executes (may have to hit enter).  Also, you may have to confirm installing it without authentication.
31
32 14 Jim Pulokas
h2. Setting up MySQL databases
33 12 Jim Pulokas
34
* create /etc/mysql/conf.d/myami.cnf with the following contents:<pre>[mysqld]
35
default-storage-engine=myisam
36
query_cache_size = 100M
37
query_cache_limit = 100M</pre>
38
* restart mysql server:<pre>sudo service mysql restart</pre>
39 14 Jim Pulokas
* create databases:<pre>sudo mysqladmin create leginondb
40 12 Jim Pulokas
sudo mysqladmin create projectdb</pre>
41 13 Jim Pulokas
* create user and grand privileges... login to mysql as root:<pre>mysql -u root mysql</pre>
42 15 Jim Pulokas
** once inside mysql client, grant privs:<pre>create user user usr_object@'localhost';
43 12 Jim Pulokas
grant all privileges on leginondb.* to usr_object@'localhost';
44 16 Jim Pulokas
grant all privileges on projectdb.* to usr_object@'localhost';
45 1 Jim Pulokas
grant alter, create, insert, select, update on `ap%`.* to usr_object@localhost;</pre>
46 4 Jim Pulokas
47 5 Jim Pulokas
h2. Setting up Apache web server
48
49
create /etc/php5/conf.d/myami.ini with the following contents:<pre>error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING
50
display_errors = On
51 8 Jim Pulokas
register_argc_argv = On
52 9 Jim Pulokas
short_open_tag = On
53 7 Jim Pulokas
max_execution_time = 300
54 10 Jim Pulokas
max_input_time = 300
55 19 Jim Pulokas
memory_limit = 256M</pre>restart apache:<pre>sudo service apache2 restart</pre>
56 20 Jim Pulokas
57
h2. Install myami
58
59 27 Jim Pulokas
* check out a sandbox from the subversion repository.  WARNING!: example here uses trunk which is generally unstable and untested.  Use at your own risk!:<pre>cd
60 20 Jim Pulokas
svn co http://emg.nysbc.org/svn/myami/trunk myami-trunk</pre>
61
* install myami python packages:<pre>cd myami-trunk
62
sudo ./pysetup.sh install
63
ADD APPION PYTHON PACKAGE INSTALL HERE</pre>
64 1 Jim Pulokas
* create image storage directory:<pre>sudo mkdir /data
65 20 Jim Pulokas
sudo mkdir /data/leginon
66 21 Jim Pulokas
sudo chmod a+w /data/leginon</pre>
67 20 Jim Pulokas
* configure python packages:<pre>cp leginon/leginon.cfg.template ~/leginon.cfg
68
cp sinedon/examples/sinedon.cfg ~/sinedon.cfg
69
cp pyscope/instruments.cfg.template ~/instruments.cfg</pre>then edit and config all three of the above files.
70
* Install myamiweb:<pre>sudo cp -r myamiweb /var/www
71
sudo chmod 777 /var/www/myamiweb</pre>
72
* setup and configure redux:<pre>sudo mkdir /var/cache/myami
73
sudo mkdir /var/cache/myami/redux
74
sudo chown -R www-data.www-data /var/cache/myami
75
sudo vim /user/local/lib/python2.7/dist-packages/redux/pipeline.py</pre>(set cache path and size)
76 22 Jim Pulokas
* initialize databases and generate config.php using web tool: http://localhost/myamiweb/setup
77 20 Jim Pulokas
* make any manual fixes to /var/www/myamiweb/config.php, such as enable redux cache, disable regular cache...
78
* Other administrative setup:
79
** http://localhost/myamiweb/admin.php
80
*** add user
81
*** import apps
82
** http://localhost/myamiweb/project/project.php
83
*** add new project
84 23 Jim Pulokas
* test if leginon starts:<pre>start-leginon.py</pre>
85 25 Jim Pulokas
86
h2. Optional additions
87
88
* for mounting external network shares
89
** install nfs-common<pre>sudo apt-get install nfs-common</pre>
90
** For automounting and similar services install NIS:<pre>sudo apt-get install nis</pre>