Project

General

Profile

Myami on Ubuntu » History » Version 32

Anchi Cheng, 09/25/2012 03:33 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 28 Anchi Cheng
* change bind-address in /etc/mysql/my.cnf to your mysql server address
35 29 Anchi Cheng
<pre>
36 28 Anchi Cheng
#bind-address = 127.0.0.1
37
bind-address = your.fixed.ip.address
38 29 Anchi Cheng
</pre>
39 28 Anchi Cheng
40 12 Jim Pulokas
* create /etc/mysql/conf.d/myami.cnf with the following contents:<pre>[mysqld]
41
default-storage-engine=myisam
42
query_cache_size = 100M
43
query_cache_limit = 100M</pre>
44
* restart mysql server:<pre>sudo service mysql restart</pre>
45 14 Jim Pulokas
* create databases:<pre>sudo mysqladmin create leginondb
46 12 Jim Pulokas
sudo mysqladmin create projectdb</pre>
47 13 Jim Pulokas
* create user and grand privileges... login to mysql as root:<pre>mysql -u root mysql</pre>
48 30 Anchi Cheng
** once inside mysql client, grant privs:<pre>create user usr_object@'localhost';
49 12 Jim Pulokas
grant all privileges on leginondb.* to usr_object@'localhost';
50 16 Jim Pulokas
grant all privileges on projectdb.* to usr_object@'localhost';
51 1 Jim Pulokas
grant alter, create, insert, select, update on `ap%`.* to usr_object@localhost;</pre>
52 4 Jim Pulokas
53 5 Jim Pulokas
h2. Setting up Apache web server
54
55
create /etc/php5/conf.d/myami.ini with the following contents:<pre>error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING
56
display_errors = On
57 8 Jim Pulokas
register_argc_argv = On
58 9 Jim Pulokas
short_open_tag = On
59 7 Jim Pulokas
max_execution_time = 300
60 10 Jim Pulokas
max_input_time = 300
61 19 Jim Pulokas
memory_limit = 256M</pre>restart apache:<pre>sudo service apache2 restart</pre>
62 20 Jim Pulokas
63
h2. Install myami
64
65 32 Anchi Cheng
* check out a sandbox from the subversion repository.  Note: You may use trunk which is generally unstable and untested but most up to date.  Use at your own risk!:<pre>cd
66
svn co http://emg.nysbc.org/svn/myami/branches/myami-2.2-redux myami-2.2-redux</pre>
67
* install myami python packages:<pre>cd myami-2.2-redux
68 20 Jim Pulokas
sudo ./pysetup.sh install
69
ADD APPION PYTHON PACKAGE INSTALL HERE</pre>
70 1 Jim Pulokas
* create image storage directory:<pre>sudo mkdir /data
71 20 Jim Pulokas
sudo mkdir /data/leginon
72 21 Jim Pulokas
sudo chmod a+w /data/leginon</pre>
73 20 Jim Pulokas
* configure python packages:<pre>cp leginon/leginon.cfg.template ~/leginon.cfg
74
cp sinedon/examples/sinedon.cfg ~/sinedon.cfg
75
cp pyscope/instruments.cfg.template ~/instruments.cfg</pre>then edit and config all three of the above files.
76
* Install myamiweb:<pre>sudo cp -r myamiweb /var/www
77
sudo chmod 777 /var/www/myamiweb</pre>
78
* setup and configure redux:<pre>sudo mkdir /var/cache/myami
79
sudo mkdir /var/cache/myami/redux
80
sudo chown -R www-data.www-data /var/cache/myami
81 31 Jim Pulokas
sudo vim /usr/local/lib/python2.7/dist-packages/redux/pipeline.py</pre>(set cache path and size)
82 22 Jim Pulokas
* initialize databases and generate config.php using web tool: http://localhost/myamiweb/setup
83 20 Jim Pulokas
* make any manual fixes to /var/www/myamiweb/config.php, such as enable redux cache, disable regular cache...
84
* Other administrative setup:
85
** http://localhost/myamiweb/admin.php
86
*** add user
87
*** import apps
88
** http://localhost/myamiweb/project/project.php
89
*** add new project
90 23 Jim Pulokas
* test if leginon starts:<pre>start-leginon.py</pre>
91 25 Jim Pulokas
92
h2. Optional additions
93
94
* for mounting external network shares
95
** install nfs-common<pre>sudo apt-get install nfs-common</pre>
96
** For automounting and similar services install NIS:<pre>sudo apt-get install nis</pre>