Project

General

Profile

Appion Home » History » Version 19

Amber Herold, 03/31/2010 04:08 PM

1 19 Amber Herold
h1. Complete Installation
2 1 Eric Hou
3 11 Amber Herold
h1. Complete Installation
4 6 Amber Herold
5
6 1 Eric Hou
7 16 Amber Herold
8 11 Amber Herold
h2. Four Parts of Leginon System
9 1 Eric Hou
10 11 Amber Herold
11 16 Amber Herold
!http://emg.nysbc.org/software/leginon/images/images/Leg_Proj_parts.png!
12 1 Eric Hou
13 11 Amber Herold
Leginon as a system that we distribute can be divided into three parts:
14 1 Eric Hou
15 6 Amber Herold
16 16 Amber Herold
17 11 Amber Herold
h2. Processing Server (Python-side)
18 1 Eric Hou
19
20 11 Amber Herold
Python (and some c) scripts that handle instrument control, data acquisition, and
21
processing.
22 1 Eric Hou
23
24
25
26 16 Amber Herold
27 11 Amber Herold
h2. Database Server (MySQL-side)
28 1 Eric Hou
29 11 Amber Herold
30
a MySQL server that handles the database
31
32
33 1 Eric Hou
34 11 Amber Herold
35 16 Amber Herold
36 11 Amber Herold
h2. Web Server (PHP-side)
37
38
39
This includes php and Java scripts at a webserver that we will create to retrieve image
40
and metadata from the database and file-storage system.
41
42
43 1 Eric Hou
44 11 Amber Herold
45 16 Amber Herold
46 11 Amber Herold
h2. File Server
47
48
49
This is up to you to set up to store lots of data coming out of Leginon system.
50
51
52
53
54 1 Eric Hou
55 11 Amber Herold
56 16 Amber Herold
57 11 Amber Herold
h2. What is in this chapter
58
59
60
61
Leginon runs under both the Linux and Microsoft Windows Operating systems. However, the
62
current php-mrctool can not be installed on Windows which means mrc images can not be viewed
63
on the web. See the section on Possible Computer Set-up Configurations for details.
64
65
66
The many components for the Leginon system are divided into packages and need to be
67
installed separately. It has been integrated with several third party software packages that
68
are necessary for its operation. The installation documentation will describe how to set-up
69
Leginon and give hints as to how to install and set-up the necessary third-party software.
70
This documentation is not intended to support the additional, but necessary third-party
71
software.
72
73
74
There has been interest in installing Leginon under Mac OS X. While this is possible in
75
theory, we have not been successful in installing a fully functional system. The two main
76
problems are (1) compilation of php-mrctool from the pre-installed php and (2) wxPython on Mac
77
is unable to hide bitmap objects which makes Leginon graphical user interface difficult to
78
use.
79
80
81 15 Amber Herold
See <link linkend="InstT_install">Installation Troubleshooting</link> and "Leginon Bulletin Board":http://emg.nysbc.org/bb/viewforum.php?f=2 searching
82 11 Amber Herold
for "install" if you run into problems.
83
84
85 1 Eric Hou
86 11 Amber Herold
87 16 Amber Herold
88 11 Amber Herold
h2.  Possible Computer Set-up Configurations
89
90
91
92
Computer(s) used for the whole Leginon system need to support five functions:
93
*  TEM/Camera control and data output (by python-side packages of Leginon
94
system)
95
96
97
*The computer attached to the microscope/camera is used for this function.
98
Therefore, it is on a Windows computer.
99
100
101
*  General Leginon operation such as target selection and image processing (processing
102
server of Leginon system)
103
104
105
*  Image data storage.
106
107
108
*  Other meta-data storage through MySQL database (by database server of Leginon
109
system)
110
111
112
*  Web server (using PHP-side of Leginon system).
113
114
115
*Important* The MRC module that is used to load mrc formatted files to the web
116
pages is not compiled on Windows. Therefore, this function must be on a linux box unless
117
you don't need to see the images***
118
119
120
121
122
123
The five functions can be distributed to five different computers on a network or all on
124
one single computer. However, since the latter minimal setup requires the use of the computer
125
attached to the microscope for all functions, it is not advisable.
126
127
128
Processing server of Leginion is a multi-platform software, meaning it can run on both
129
Microsoft Windows and Linux. It is also inherently designed to utilize distributed systems on
130
a network. MySQL used in the database server is also supported by multiple platforms. This is
131
not true for the Web server because the custom MRC module used in the web viewer only compiles
132
on linux machines. Therefore, one of the computer not part of the microscope must be a linux.
133
The following examples show several arrangements that take advantage of distributed system.
134
Other combinations are possible, but will basically be variations on one of the following
135
themes.
136 1 Eric Hou
137 11 Amber Herold
138 16 Amber Herold
139 11 Amber Herold
h2.  A: 1 Windows computer (attached to the Microscope) &amp; 1 Linux computer (for all
140
other functions, separate from the Microscope) (Good for single user and small-scale
141
acquisition)
142
143
144
145
146
147
*  Install the latest processing server side of Leginon release (and supporting
148
packages) on the Windows computer controlling the microscope and on the Linux computer
149
which is to run Leginon image acquisition and processing.
150
151
152
*  Install the additional modules needed for CCD camera and film interaction on the
153
Windows computer controlling the microscope.
154
155
156
*  Install MySQL, PHP, the Apache Web Server, and dbem tools only on the Linux
157
computer that will perform these functions, (i.e. NOT the computer controlling the
158
microscope).
159
160
161
162
163
164
165 1 Eric Hou
166 11 Amber Herold
167 16 Amber Herold
168 11 Amber Herold
h2.  B: 1 Windows computer (attached to the Microscope) &amp; 4 Linux computers (one for
169
each function) (Good for multiple microsopes, users and large-scale acquisition)
170
171
172
173
This is the set-up at NRAMM. It has the processing server side of Leginon installed on
174
the Windows computer attached to the microscope and on the Linux computer that is used for
175
running Leginon. A second Linux machine is dedicated to the database while the web-based
176
viewer is hosted by another server.
177
178
179
180
181
*  Install the python-side Leginon (and supporting packages) on the Windows computer
182
controlling the microscope and on the Linux computer that is to run Leginon. You can
183
make the latter installation accessable to any numbers of linux computers on your
184
network.
185
186
187
*  Install MySQL, PHP, the Apache Web Server, and dbem tools on the second Linux
188
computer that will serve as the database/web server/PHP host.
189
190
191
*  The computer hosting the data storage should be accessable by all linux
192
boxes.
193
194
195
196
197
198
199 1 Eric Hou
200 11 Amber Herold
201 16 Amber Herold
202 11 Amber Herold
h2.  C: 1 Windows computer (attached to the Microscope), 1 Windows computer running python-
203
and MySQL-side functions and 1 Linux computer as web server (Has been applied
204
successfully)
205
206
207
208
The data storage may be on one of these computers that is accessable by other
209
computers.
210
211
212
213
214 1 Eric Hou
215 11 Amber Herold
216 16 Amber Herold
217 11 Amber Herold
h2.  Ports that Leginon system uses:
218
219
220
221
This information is useful if you want to open specific ports between computers with a
222
firewall in between.
223
224
225
226
227
* MySQL normally uses port 3306 (but configurable in /etc/my.cnf)
228
229
230
* Leginon Client running on TEM host: port 55555
231
232
233
* Leginon main program on the processing server: dynamically assigned ports between
234
49152 and 65535
235
236
237
There is no strict port assignment since we could potentially have more than one
238
Leginon process running on the same linux host talking to different TEM hosts. It is
239
probably good enough if you only worry about opening up the first few of those ports in
240
your firewall (maybe 49152 through 49160, or something like that).
241
242
243
See more discussion at Leginon bulletin board thread on ""network problem, Leginon not seeing
244 15 Amber Herold
tecnai host":http://emg.nysbc.org/bb/viewtopic.php?t=7 "
245 11 Amber Herold
246
247
248
249
250
251 1 Eric Hou
252 11 Amber Herold
253 16 Amber Herold
254 15 Amber Herold
h2. Where to Register and download Leginon system
255 11 Amber Herold
256
257
258
"http://www.leginon.org/":http://www.leginon.org is the home. Please
259
register if you want to recieve support from Leginon team.
260
261 1 Eric Hou
262
*  python-side Leginon packages
263
264 11 Amber Herold
265 16 Amber Herold
direct link: "http://emg.nysbc.org/software/leginon/":http://emg.nysbc.org/software/leginon/ *  mrctools: including the tools for reading mrc images on the web
266 11 Amber Herold
267
268 16 Amber Herold
direct link: "http://emg.nysbc.org/software/mrctools/":http://emg.nysbc.org/software/mrctools/ *  dbemtools: including the tools for administration and webviewing
269 1 Eric Hou
270 11 Amber Herold
271 16 Amber Herold
direct link: "http://emg.nysbc.org/software/dbemtools/":http://emg.nysbc.org/software/dbemtools/ *  project tools (optional): For administration and webviewing of projects
272 11 Amber Herold
273
274 16 Amber Herold
direct link: "http://emg.nysbc.org/software/dbemtools/":http://emg.nysbc.org/software/dbemtools/ h2.  Processing server-side Leginon Installation
275 11 Amber Herold
276
277
278 1 Eric Hou
For the lack of better name, processing server-side Leginon refers to packages that
279 11 Amber Herold
performs the general functions of image acquisition and processing. The instructions here are
280 1 Eric Hou
for Linux. Refer to Windows Installation for Windows specific instructions.
281 11 Amber Herold
282
283 16 Amber Herold
284 11 Amber Herold
h2. Download svn checkout script from Leginon website
285
286
287
288
"http://www.leginon.org/":http://www.leginon.org/ Download
289 15 Amber Herold
svnget-1.6.sh to a convenient location such as your home directory.
290 11 Amber Herold
291
292
293
294 16 Amber Herold
295 11 Amber Herold
h2. Check out SVN Source Files from the depository
296
297
298
299
run svnget-1.6.sh. It does the
300 17 Amber Herold
following:<pre>mkdir Leginon-1.6-ALL
301 11 Amber Herold
cd Leginon-1.6-ALL
302
svn co http://emg.nysbc.org/svn/leginon/branches/1.6 Leginon
303 1 Eric Hou
svn co http://emg.nysbc.org/svn/pyami/branches/leg1.6 pyami
304 11 Amber Herold
svn co http://emg.nysbc.org/svn/pyScope/branches/leg1.6 pyScope
305
svn co http://emg.nysbc.org/svn/sinedon/branches/leg1.6 sinedon
306
svn co http://emg.nysbc.org/svn/numextension/branches/leg1.6 numextension
307
svn co http://emg.nysbc.org/svn/libcv/branches/leg1.6 libcv
308
svn co http://emg.nysbc.org/svn/ImageViewer/branches/leg1.6 ImageViewer</pre>
309
310
311
If the process fails, you probably do not have svn client installed. Skip to "Install
312
the supporting packages first if missing:", then try this again.
313
314
315
316
317 16 Amber Herold
318 11 Amber Herold
h2.  Perform system check:
319
320
321
322
In addition to the downloads from our svn depository, there are several other
323
requirements that you will get either from your OS installation source, or from its
324
respective website. The system check in the Leginon package checks your system to see if you
325
already have these requirements
326
327 1 Eric Hou
328 11 Amber Herold
329
<pre>cd your_download_area/Leginon-1.6-ALL/Leginon
330
python syscheck.py</pre>
331
332
333
334
If python is not installed, this, of course will not run. If you see any lines like "***
335
Failed...", then you have something missing. Otherwise, everything should result in
336
"OK".
337
338
339
340
341 16 Amber Herold
342 11 Amber Herold
h2.  Install the supporting packages first if missing:
343
344
345
346
Follow the instruction for your specific Linux distribution.
347 1 Eric Hou
348 11 Amber Herold
349
For example, SUSE users can use YaST to install them; RedHat and CentOS users can use
350
yum.
351
352
353
*SciPy may not build properly on some versions of SuSE due to an incompatible LAPACK
354
package that comes with SuSE. You can get scipy as well as a compatible LAPACK etc. from
355
http://repos.opensuse.org/science (need to specify your SuSE version and machine
356
etc.)
357
358
359 1 Eric Hou
360 11 Amber Herold
361 16 Amber Herold
362 11 Amber Herold
h2.  Required supporting packages:
363
364 1 Eric Hou
365 11 Amber Herold
366 14 Amber Herold
367 11 Amber Herold
|_.Name:|_.Download site:|_.yum package name|_.SuSE rpm name|
368 15 Amber Herold
|Python 2.4 or newer|"http://www.python.org":http://www.python.org |python|python-devel|
369
|wxPython 2.5.2.8 or newer|"http://www.wxpython.org":http://www.wxpython.org |wxPython|python-wxGTK|
370
|MySQL Python client 1.2 or newer|"http://sourceforge.net/projects/mysql-python":http://sourceforge.net/projects/mysql-python |MySQL-python|python-mysql|
371
|Python Imaging Library (PIL) 1.1.4 or newer|"http://www.pythonware.com/products/pil/":http://www.pythonware.com/products/pil/ |python-imaging|python-imaging|
372
|Python XML module 0.8.3 or newer|"http://pyxml.sourceforge.net":http://pyxml.sourceforge.net |PyXML|python-xml|
373 1 Eric Hou
|NumPy 1.0.1 or newer|"http://www.scipy.org":http://www.scipy.org |numpy|numpy|
374 15 Amber Herold
|SciPy 0.5.1 (tested, others may work)*|"http://www.scipy.org":http://www.scipy.org , "http://repos.opensuse.org/science":http://repos.opensuse.org/science *|scipy|python-scipy|
375 11 Amber Herold
376
377
378
379
*SciPy may not build properly on some versions of SuSE due to an incompatible LAPACK
380
package that comes with SuSE. You can get scipy as well as a compatible LAPACK etc. from
381
http://repos.opensuse.org/science (need to specify your SuSE version and machine
382 1 Eric Hou
etc.)
383 11 Amber Herold
384
385
386
387 16 Amber Herold
388 11 Amber Herold
h2.  Optional supporting packages:
389
390
391
392
393
394
*  For using Matlab to explore holefinding algorithm (Matlab HoleFinder)
395
396
397 16 Amber Herold
pymat: "http://sourceforge.net/projects/pymat":http://sourceforge.net/projects/pymat h2. Install the packages you downloaded from svn depository
398 11 Amber Herold
399
400
401
Here are the packages you need to install with python installer inside the
402
Leginon-1.6-ALL folder.
403 1 Eric Hou
404 11 Amber Herold
405 14 Amber Herold
406 11 Amber Herold
|_.Name:|_.Purpose:|
407
| Leginon|modular TEM image acquisition|
408
| pyami|general functions|
409
| pyScope|microscope control and monitoring|
410
| sinedon|Leginon/database interaction|
411
| numExtension|c extension for numerical processing|
412
| libCV|small c library of algorithm from computer vision field|
413
| ImageViewer|image viewing for tomography|
414
415
416
417
418
419
420
*  run syscheck.py again to make sure you have everything.
421
422 1 Eric Hou
423 19 Amber Herold
*  Install the package in _each folder_ with commands
424 11 Amber Herold
like
425
these<pre>cd /your_download_area/Leginon-1.6-ALL/Leginon
426 1 Eric Hou
python setup.py install
427 11 Amber Herold
428
cd ../pyami
429
python setup.py install
430
cd ../pyScope
431
python setup.py install
432
cd ../sinedon
433
python setup.py install
434
cd ../numextension
435
python setup.py install
436
cd ../libcv
437
python setup.py install
438
cd ../ImageViewer
439
python setup.py install</pre>
440
441
442
443
444
445
446
447
448 16 Amber Herold
449 11 Amber Herold
h2.  python-site-package-path: where the installed python
450
packages went:
451
452
453
Python installer put the packages you installed to its site-packages directory. This
454
enable all users on the same computer to access them. The easiest way to find where your
455
installed package is called by python is to load a module from the package using interactive
456
python command lines like this:
457
458
459
460
461
*  Start python command line from shell
462
463
464
465
<pre>> python</pre>
466
467
468
469
*  Import a module from the package. Let's try sinedon here. All packages installed
470
through the above setup.py script should go to the same place.
471
472
473
474
<pre>python> import sinedon</pre>
475
476
477
478 1 Eric Hou
*  If the module is loaded successfully, call the module attribute __path__ (two
479 11 Amber Herold
underscrolls before "path" and two underscrolls after) will return the location of the
480
module it is loaded from
481
482
483
484
<pre>python> sinedon.__path__
485
486
RETURNS, For example,
487
python> &lt;module 'sinedon' from '/usr/lib/python2.5/site-packages/sinedon/__init__.pyc'> </pre>
488
489
490
In this case, /usr/lib/python2.5/site-packages/ is your python-site-package-path.
491
If you go to that directory, you will find all the packages you just installed.
492
493
494
495
496
497
498
499
500 16 Amber Herold
501 11 Amber Herold
h2.  Configure leginon.cfg:
502
503
504
Leginon can be configured at three levels:
505
506
507
508
509
*  A skeleton (default) configuration file is available:
510
511 1 Eric Hou
512 11 Amber Herold
513 19 Amber Herold
<pre> _<link linkend="package_path">[python-site-package-path]</link>_/Leginon/config/default.cfg</pre>
514 11 Amber Herold
515
516
517
*  Configurations for all users
518 1 Eric Hou
519 11 Amber Herold
520
521 19 Amber Herold
<pre> _<link linkend="package_path">[python-site-package-path]</link>_/Leginon/config/leginon.cfg</pre>
522 11 Amber Herold
523
524
525 1 Eric Hou
Example of the configuration that you should set: (Here we assume your leginon
526 11 Amber Herold
database is named "dbemdata", and Leginon log into the database as a user named
527
"usr_object" with no password
528
set).<pre>[Images]
529 19 Amber Herold
path: _your_storage_disk_path_/leginon
530 11 Amber Herold
</pre>
531
532 1 Eric Hou
533 11 Amber Herold
*  Configurations for individual users that overrides the all-user configuration if
534
exists
535
536
537
538
<pre> ~/leginon.cfg</pre>
539
540 1 Eric Hou
541 11 Amber Herold
542
This configuration should include all the minimal configuration above and
543
additional configuration for individual user for
544
convenience<pre>[User]
545 19 Amber Herold
Fullname: _your_name_  #The name you entered in the leginon administration web page. Note that it is case sensitive</pre>
546 11 Amber Herold
547
548
549
550
551
552
553
554 16 Amber Herold
555 11 Amber Herold
h2.  Names used in the example installation
556
557
558
From this point on, you will need to enter database user names for different
559
configuration files and settings. These are NOT Leginon user names but what is required by
560
MySQL database interaction. Consistent names are essential. In the example shown here, the
561
leginon database is called "dbemdata", the project database is called "projectdata". The
562
MySQL user name are the same, "usr_object", and in this case without a password.
563
564
565
566
567 16 Amber Herold
568 11 Amber Herold
h2.  Configure sinedon.cfg:
569
570
571
Sinedon is designed to be able to interact with multiple databases. It can be
572
configured at global or user level.
573
574
575
576
577
*  An example configuration file is available at:
578
579
580
581
<pre>/your_download_area/Leginon-1.6-ALL/sinedon/examples/sinedon.cfg</pre>
582
583 1 Eric Hou
584 11 Amber Herold
585
*  Configurations for all users should be placed at the following path
586
587
588
589 19 Amber Herold
<pre>  _<link linkend="package_path">[python-site-package-path]</link>_/sinedon/sinedon.cfg</pre>
590 11 Amber Herold
591
592
593 1 Eric Hou
*  Modify host,db,user,passwd to what is used. Note that the user here is MySQL user
594 11 Amber Herold
Leginon uses to communicate with the database for all Leginon users. For Leginon that
595
uses Project database, set the following:
596
597
598
599
<pre>[global]
600 19 Amber Herold
host: _your_database_host_
601 11 Amber Herold
user: usr_object
602
passwd:
603
604
[projectdata]
605
db: projectdata
606
607
[leginondata]
608
db: dbemdata
609
</pre>
610
611 1 Eric Hou
612 11 Amber Herold
613
*  Add database configuration if you intend to use grid-inserting robot. The Robot2
614
module uses the database to communicate to the robot. Applications that carries the
615
name "Robot" requires this to be set. In general, using the same database as the
616
general leginon database is fine.
617
618
619
620
<pre>[robot2]
621
db: dbemdata</pre>
622
623
624
625
626
627
628
629
630 1 Eric Hou
631 11 Amber Herold
632
633 16 Amber Herold
634 11 Amber Herold
h2. Database Server-side Installation
635
636
637
638
The following is for the computer that hosts the databases. This involves installing MySQL
639
server and creation/configuration of the leginon and project databases.
640
641 1 Eric Hou
642 11 Amber Herold
643 14 Amber Herold
644 11 Amber Herold
645 15 Amber Herold
|_.Name:|_.Download site:|
646 1 Eric Hou
|MySQL-Server 5.0 or higher|"http://www.mysql.com":http://www.mysql.com |
647 15 Amber Herold
|MySQL-Client 5.0 or higher|"http://www.mysql.com":http://www.mysql.com |
648 11 Amber Herold
649
650
651
652 16 Amber Herold
653 11 Amber Herold
h2.  MySQL
654
655
656
657
658
659
*  Install MySQL-Server
660
661
662
663
664
*  Use your package installer (yum, zypper, YaST) if available.
665
666 1 Eric Hou
667 11 Amber Herold
OR
668
669
670 16 Amber Herold
*  Download the latest MySQL-server RPM for Linux from "www.mysql.com":http://www.mysql.com *  Install the MySQL-server rpm:
671 11 Amber Herold
672
673
<pre> rpm -Uvh MySQL-server-5.0.xx-y.i386.rpm</pre>
674
(substitute correct version numbers)
675
676
677
678
679
680
681
*  Install MySQL-Client
682
683
684
685
686
*  Use your package installer (yum, zypper, YaST) if available.
687
688
689
OR
690
691
692 16 Amber Herold
*  Download the latest MySQL-client RPM for Linux from "www.mysql.com":http://www.mysql.com *  Install the MySQL-client rpm:
693 11 Amber Herold
694
695
<pre> rpm -Uvh MySQL-client-5.0.xx-y.i386.rpm</pre>
696
(substitute correct version numbers)
697
698
699
700
701
702
703
*  MySQL configuration file is usually located in /usr/share/mysql. There are
704
several examples there:
705
706
707
708
<pre>&gt; ls /usr/share/mysql/my*
709
/usr/share/mysql/my-huge.cnf
710
/usr/share/mysql/my-innodb-heavy-4G.cnf
711
/usr/share/mysql/my-large.cnf
712
/usr/share/mysql/my-medium.cnf
713
/usr/share/mysql/my-small.cnf
714
&gt; </pre>
715
716
717
718
*  Configure my.cnf in /etc using my-huge.cnf as the template
719
720
721
722
723
* <pre>> cp /usr/share/mysql/my-huge.cnf /etc/my.cnf</pre>
724
725
726
727
*  Edit /etc/my.cnf to add or change query cache variables like these:
728
729
<pre>query_cache_type= 1
730
query_cache_size = 100M
731
query_cache_limit= 100M</pre>
732
733
734
735
736
737
738
739
*  start MySQL Server
740
741
<pre> &gt;/etc/init.d/mysqld start</pre>
742
743
on some installation,
744
745
<pre> &gt;/etc/init.d/mysql start</pre>
746
747
For future reference: start | stop | restart MySQL Server with similar
748
commands:
749
750
<pre> &gt;/etc/init.d/mysqld start
751
&gt;/etc/init.d/mysqld stop
752
&gt;/etc/init.d/mysqld restart</pre>
753
754
If you want to start MySQL automatically at boot on SuSE
755
756
<pre> SuSE &gt;chkconfig mysql on
757
</pre>
758
759
*  For future reference, the database location will be:
760
761
762
763
<pre>&gt; cd /var/lib/mysql
764
Directory: /var/lib/mysql
765
&gt; ls
766
yourdbserver.pid
767
ib_logfile0
768
mysql
769
mysql.sock
770
test
771
&gt; </pre>
772
773
774
775
*  Create leginon database, here we call <link linkend="db_example_names"
776
>dbemdata</link>
777
778
<pre> &gt;mysqladmin create dbemdata</pre>
779
780
781
782
*  Create project database, here we call <link linkend="db_example_names"
783
>projectdata</link> (optional)
784
785
<pre> &gt;mysqladmin create projectdata</pre>
786
787
788
789
*  Connect to mysql db
790
791
<pre>&gt;mysql mysql
792
793
mysql&gt; select user, password, host from user;
794
+------+----------+-----------+
795
| user | password | host      |
796
+------+----------+-----------+
797
| root |          | localhost |
798
| root |          | host1     |
799
|      |          | host1     |
800
|      |          | localhost |
801
+------+----------+-----------+
802
4 rows in set (0.00 sec)</pre>
803
804
805
806
*  Create and grant privileges to a user called <link linkend="db_example_names"
807
>usr_object</link> for the databases on both the localhost and other hosts involved.
808
For example, use wild card '%' for all hosts. You may also set specific privilege to
809
the user. See MySQL Reference Manual for details
810
811
<pre>mysql&gt; create user usr_object@'localhost';
812
mysql&gt; grant all privileges on dbemdata.* to usr_object@'localhost';
813
mysql&gt; grant all privileges on projectdata.* to usr_object@'localhost';</pre>
814
815
Similarly,
816 1 Eric Hou
817 11 Amber Herold
<pre>mysql&gt; create usr_object@'%';
818
mysql&gt; grant all privileges on dbemdata.* to usr_object@'%';
819
mysql&gt; grant all privileges on projectdata.* to usr_object@'%';
820
</pre>
821
822
*  Change Root passworld
823
824 19 Amber Herold
<pre>mysql&gt; update user set password=password('_a passwd_') where user="root";
825 1 Eric Hou
Query OK, 2 rows affected (0.01 sec)
826 11 Amber Herold
Rows matched: 2  Changed: 2  Warnings: 0
827 1 Eric Hou
828 11 Amber Herold
mysql&gt;^D or exit;</pre>
829
From now on, you will need to specify the password to connect to the database as
830
root user like this:
831
832
<pre>>mysql -u root -p mysql</pre>
833
834 19 Amber Herold
_***If your password change does not take effect in your next
835 11 Amber Herold
database connection, you will need to flush the mysql pivileges cache as mysql root
836
and connecting with you old password (or no password in the above
837 19 Amber Herold
case):_
838 11 Amber Herold
839
<pre>>mysql -u root mysql</pre>
840
<pre>mysql&gt; flush privileges;
841
mysql&gt;^D or exit;</pre>
842
843
*  Check MySQL variables
844
845
<pre>&gt;mysql -u usr_object dbemdata
846
847
mysql&gt; SHOW VARIABLES LIKE 'query%';
848
+------------------------------+-----------+
849
| Variable_name                | Value     |
850
+------------------------------+-----------+
851
| ft_query_expansion_limit     | 20        |
852
| have_query_cache             | YES       |
853
| long_query_time              | 10        |
854
| query_alloc_block_size       | 8192      |
855
| query_cache_limit            | 104857600 | &lt;&lt;---This should correspond to your change
856
| query_cache_min_res_unit     | 4096      |
857
| query_cache_size             | 104857600 | &lt;&lt;---This should correspond to your change
858
| query_cache_type             | ON        | &lt;&lt;---This should correspond to your change
859
| query_cache_wlock_invalidate | OFF       |
860
| query_prealloc_size          | 8192      |
861
+------------------------------+-----------+
862
10 rows in set (0.00 sec)
863
864
mysql&gt; exit;</pre>
865
866
867
868
*  Make sure MySQL is running
869
870
<pre>prompt:~&gt; mysqlshow
871
+--------------+
872
| Databases    |
873
+--------------+
874
| mysql        |
875 1 Eric Hou
| dbemdata     |
876 11 Amber Herold
| projectdata  |
877
+--------------+</pre>
878
879
880
881
*  Or check with the following php script (if already installed)
882
883
<pre>&lt;?
884 1 Eric Hou
mysql_connect('your_host.your_institute.edu', 'usr_object', '','dbemdata');
885 11 Amber Herold
echo mysql_stat();
886
?&gt; </pre>
887
888
889
Output
890
891
<pre> Uptime: 1452562 Threads: 1 Questions: 618 Slow queries: 0 Opens: 117 Flush tables: 1 Open tables: 106 Queries per second avg: 0.000</pre>
892
893
894
895
896
897
898
899
900
901 16 Amber Herold
902 11 Amber Herold
h2.  Web server set up and Installation
903
904
905
906
The following applies to the computer that will host the web-accessable image viewers ( a
907
part of dbem tools) and project manager (a part of project tools).
908 1 Eric Hou
909 11 Amber Herold
910 16 Amber Herold
911 11 Amber Herold
h2. Differences between Linux flavors
912
913
914
915
Different Linux flavors often put web server and mysql-related files in different
916
locations. This can be confusing. From experience, we found the equivalent on CentOS vs
917
SuSE. Here we list them for reference. If your system use a different naming and you are
918
willing to share your experience, please send us the list. We will add it here:
919
920 1 Eric Hou
921 11 Amber Herold
922 14 Amber Herold
|_.File or Command Head|_.CentOS|_.SuSE|
923 11 Amber Herold
| php.ini|/etc/| /etc/php5/apache2/|
924
| httpd.conf|/etc/httpd/conf/|/etc/php5/apache2/|
925
| default document_root|/var/www/html/|/srv/www/htdocs/|
926
| apache start/stop/restart command head|/etc/init.d/httpd|/etc/init.d/apache2|
927
| mysql start/stop/restart command head|/etc/init.d/mysqld|/etc/init.d/mysql|
928
929
930 1 Eric Hou
931
932 11 Amber Herold
933
934 16 Amber Herold
935 11 Amber Herold
h2. Prerequisites for dbemtools, projecttools, and mrctools extension
936
937
938
939
The dbemtools are mostly php scripts that run at the web server. The followings are
940
required before installation of dbemtools and the mrc extension that handles mrc files to be
941
displayed. Some of these packages may be found on the SuSE Linux DVD or included in common
942 1 Eric Hou
package repository. MySQL and the Apache Web Server can be downloaded from their respective
943
websites.
944 11 Amber Herold
945 1 Eric Hou
946 11 Amber Herold
947 14 Amber Herold
|_.Name:|_.Download site:|_.yum package name|_.SuSE rpm name|
948 11 Amber Herold
| Apache|"www.apache.org":http://www.apache.org | httpd| apache2|
949 15 Amber Herold
| php|"www.php.net":http://www.php.net | php| php|
950
| php-devel*|"rpmfind.net/linux/RPM/Development_Languages_PHP.html":http://rpmfind.net/linux/RPM/Development_Languages_PHP.html | php-devel| php-devel|
951
| php-gd (including GD library, its development libraries and header *)|"www.php.ned/gd":http://www.libgd.org (Use gd2)| php-gd, gd-devel| php-gd,gd-devel|
952
| fftw3 library (including development libraries and header *)|"www.fftw.org":http://www.fftw.org (Use fftw3.x)| fftw3-devel| fftw3-devel|
953
954 11 Amber Herold
955
956
957
* mrctools are compiled and added to php extension with php-devel package. Mrctools use
958
GD and FFTW3 that need to be compiled from their development libraries while the extension
959
is compiled. If GD and FFTW3 sources were downloaded and compiled directly on your computer,
960
these development files are included. If (as in most cases) GD and FFTW3 are installed from
961
rpm, they are not included. An error message will appear when you attempt to compile
962
mrctools. In this case, you will need separate download and installation of GD-devel and
963
FFTW3-devel. Search "http://rpmfind.net/linux/rpm2html/":http://rpmfind.ned/linux/rpm2html/ for GD-devel and FFTW3-devel for the rpm
964 15 Amber Herold
distribution needed for your system.
965 1 Eric Hou
966 11 Amber Herold
967
968
969 16 Amber Herold
970 11 Amber Herold
h2. Installation tools
971 1 Eric Hou
972 11 Amber Herold
973
974
Use the installation tools available for your linux distribution.
975
976
977
978
979
*  For example, Use yum utility to install.
980
981
982
*  For example, Use the SuSE Linux YaST2 utility or zypper (openSuSE 10.2 and above)
983
to install.
984
985
986
* "A list of required CENTOS
987 1 Eric Hou
rpms and instruction":http://emg.nysbc.org/bb/viewtopic.php?t=238 can be found at dbemtools bulletin board at
988 11 Amber Herold
leginon.org.
989 15 Amber Herold
990 11 Amber Herold
991
992
993
994
995
996
997 16 Amber Herold
998 11 Amber Herold
h2.  PHP, PHP-devel, gd, and fftw3
999
1000
1001
Install the packages using your installation tools if available. For example, to
1002
install gd as php extension you may use
1003
1004
1005
1006 17 Amber Herold
<pre>CentOS> yum install php-gd
1007 11 Amber Herold
SuSE10.2 and above> zypper install php-gd</pre>
1008
1009
1010
1011
1012
1013 16 Amber Herold
1014 11 Amber Herold
h2.  Configure php.ini
1015
1016
1017
1018
Edit the following two sections in php.ini (found as /etc/php.ini on CentOS and
1019 1 Eric Hou
/etc/php5/apache2/php.ini on SuSE) so that they look like the following:
1020 11 Amber Herold
1021
1022
1023
<pre>register_argc_argv = On</pre>
1024
1025
1026
1027
1028
<pre>short_open_tag = On</pre>
1029
1030
1031
1032
1033
<pre>max_execution_time = 300     ; Maximum execution time of each script, in seconds
1034
max_input_time = 300     ; Maximum amount of time each script may spend parsing request data
1035
memory_limit = 256M      ; Maximum amount of memory a script may consume (8MB)</pre>
1036
1037
1038
1039
You may want to increase max_input_time and memory_limit if the server is heavily used.
1040
At NRAMM, max_input_time=600 and memory_limit=4000M.
1041
1042
1043
1044
1045 16 Amber Herold
1046 11 Amber Herold
h2.  Apache Web Server
1047
1048
1049
1050
1051
1052
*  Install the Apache Web Server with the YaST or yum utility.
1053
1054
1055
*  Find "httpd.conf".
1056
1057
1058
This is /etc/httpd/conf/httpd.conf on CentOS and /etc/php5/apache2/httpd.conf on
1059
SuSE
1060
1061
1062
*  Edit the "httpd.conf" configuration file to look like the following:
1063
1064
1065
1066
<pre>&lt;IfModule mod_dir.c&gt;
1067
DirectoryIndex index.htm index.shtm index.html index.shtml index.php
1068
&lt;/IfModule&gt;</pre>
1069
1070
1071 1 Eric Hou
(Note: It may be possible to edit httpd.conf in YaST2 as well.)
1072 11 Amber Herold
1073
1074
*  Restart the web server.
1075
1076
1077
1078
<pre>apachectl restart
1079
or
1080
/etc/init.d/httpd restart     (ON CentOS)
1081
or
1082
/etc/init.d/apache2 restart   (ON SuSE)</pre>
1083
1084
1085
1086
If you want to start the web server automatically at boot on SuSE
1087
1088
<pre> SuSE &gt;chkconfig apache2 on
1089
</pre>
1090
1091
1092
1093 1 Eric Hou
1094 11 Amber Herold
1095
1096
1097 16 Amber Herold
1098 11 Amber Herold
h2. Check php information
1099 1 Eric Hou
1100 11 Amber Herold
1101
Create the following info.php in your web server document root directory (/var/www/html
1102
on CentOS. /srv/www/htdocs on SuSE. You can find its location in httpd.conf mentioned above
1103
under the line starting
1104
DocumentRoot).<pre>&lt;?php
1105
phpinfo();
1106
?&gt;</pre>
1107
1108 1 Eric Hou
1109 11 Amber Herold
Visit this page at http://yourhost/info.php
1110
1111
1112
You will see comprehensive tables of php and apache information, including the location
1113
of the addition .ini files, extension, include path, and what extension is enabled.
1114
1115
1116
Here is an example screen shot of the part of the info.php page that tells you where
1117
php.ini and other configuration files are.
1118
1119
1120
1121 16 Amber Herold
!http://emg.nysbc.org/software/leginon/images/images/phpini.png!
1122 11 Amber Herold
1123
1124 1 Eric Hou
1125 11 Amber Herold
1126
1127 16 Amber Herold
1128 11 Amber Herold
h2.  mrctools Installation
1129
1130
1131
1132
mrctools are installed as php extension and are required for displaying mrc files live
1133
on the web browser.
1134
1135 1 Eric Hou
1136 16 Amber Herold
1137 11 Amber Herold
h2.  Install php-devel packages on the web server if missing:
1138
1139
1140
You can check whether php-devel is installed by
1141
typing<pre> &gt;phpize</pre>
1142
1143
1144
Follow the instruction for your specific Linux distribution.
1145
1146
1147
For example, SUSE users can use YaST or zypper to install them
1148
1149
1150
1151
1152 16 Amber Herold
1153 11 Amber Herold
h2.  php-GD/FFTW3-devel
1154
1155
1156
1157
Follow instructions from the download site. These may be included already. If not,
1158
mrctools installation will fail.
1159
1160
1161
1162 1 Eric Hou
1163 16 Amber Herold
1164 11 Amber Herold
h2.  mrctools Installation
1165
1166
1167
1168
mrctools are installed from php devel directory. This is usually /usr/include/php/ext
1169
where you will find other php extension source such as gd. After the installation, mrc.so
1170
should be placed in php's extension directory (Look for "extension_dir" in
1171 1 Eric Hou
http://your_host/<link linkend="install_infophp">info.php</link>
1172 11 Amber Herold
1173
1174
1175
1176 15 Amber Herold
*  Download dbem tools from "http://emg.nysbc.org/software/mrctools":http://emg.nysbc.org/software/mrctools .
1177 11 Amber Herold
1178
1179 15 Amber Herold
*  Follow the instruction at "http://emg.nysbc.org/software/mrctools/mrc_so.php":http://emg.nysbc.org/software/mrctools/mrc_so.php for installation and
1180 1 Eric Hou
testing. The next session about checking php information can also help debugging the
1181 11 Amber Herold
installation
1182
1183
1184
1185
1186
1187
1188
1189
1190 16 Amber Herold
1191 11 Amber Herold
h2.  Check php information
1192
1193
1194
1195
Visit or refresh http://yourhost/info.php <link linkend="install_infophp">which you
1196
created earlier</link>. It should have a section looking like this (The version should
1197
correspond to what you've just installed):
1198
1199
1200
1201 16 Amber Herold
!http://emg.nysbc.org/software/leginon/images/images/phpmrc.png!
1202 11 Amber Herold
1203
1204
1205
If mrc is not listed, the extension did not get added at the right order.
1206
1207
1208
1209
1210 16 Amber Herold
1211 11 Amber Herold
h2.  Alternative approach if mrc module does not show up in info.php output
1212
1213
1214
1215
* find in the <link linkend="install_infophp">info.php web page</link> the location
1216
of "additional .ini files parsed" in the first table (such as
1217
/etc/php.d/conf.d/*).
1218
1219
1220
*  Go to the directory and make a copy of any ini file to use as a template for
1221
mrc.ini
1222
1223
1224
1225
<pre>&gt;cd [additional_ini_directory]
1226
&gt;cp gd.ini mrc.ini</pre>
1227
1228
1229
1230
*  Edit mrc.ini to the following
1231
1232 1 Eric Hou
1233 11 Amber Herold
1234
<pre>; comment out next line to disable mrc extension in php
1235
extension=mrc.so</pre>
1236
1237
1238
1239
*  Comment out mrc extension from php.ini (found in /etc/php.ini/ on a typical PHP
1240
installation)
1241
1242
1243
1244
<pre>;extension=mrc.so</pre>
1245
1246
1247
1248
*  restart your webserver
1249
1250
1251
1252
<pre>&gt; /etc/init.d/httpd restart</pre>
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262 16 Amber Herold
1263 11 Amber Herold
h2.  Web Viewing Tools (dbemtools) Linux
1264
Installation
1265
1266
1267
1268
php and java scripts for viewing images and Leginon information through the web
1269
server.
1270
1271
1272
1273
1274 15 Amber Herold
*  Download dbem tools from "http://emg.nysbc.org/software/dbemtools":http://emg.nysbc.org/software/dbemtools .
1275 11 Amber Herold
1276
1277
*  Unpack the package in your [webdirectory]
1278
1279
1280
1281
<pre>&gt;cd [webdirectory]			#/var/www/html in this example
1282
[webdirectory&gt;tar zxvf dbem_1_5_1.tgz</pre>
1283
1284
1285
1286
*  Copy config.php.template to config.php and edit the latter by adding these MySQL
1287
parameters:
1288
1289
"config.php" should be located in /var/www/html/dbem_1_5_1/ on CentOS and
1290
/srv/www/htdocs/dbem_1_5_1/ on SuSE.
1291
1292
1293
1294
<pre>&lt;?
1295
// ---define dbem web tools base ---//
1296
define('BASE_URL',"/dbem_1_5_1/";
1297
// --- Leginon Viewer Configuration --- //
1298
1299 1 Eric Hou
// --- Set your leginon MySQL database server parameters
1300 11 Amber Herold
1301
$DB_HOST    = "[your database host]";
1302
$DB_USER    = "<link linkend="db_example_names">usr_object</link>";
1303
$DB_PASS    = "";
1304
$DB        = "<link linkend="db_example_names">dbemdata</link>";
1305
1306
// --- XML test dataset
1307
$XML_DATA = "test/viewerdata.xml";
1308
1309
// --- Project database config
1310
1311 1 Eric Hou
$PROJECT_URL = "/project_1_2";
1312 11 Amber Herold
$PROJECT_DB_HOST = "[your database host]";
1313
$PROJECT_DB_USER = "<link linkend="db_example_names">usr_object</link>";
1314
$PROJECT_DB_PASS = "";
1315
$PROJECT_DB = "<link linkend="db_example_names">projectdata</link>";
1316
</pre>
1317
1318
1319
1320
*  Test the set-up by visiting http://yourhost/dbem_1_5_1
1321 1 Eric Hou
1322 11 Amber Herold
1323
1324
1325
1326
1327
1328
1329 16 Amber Herold
1330 11 Amber Herold
h2.  Project management tools Linux Installation
1331
1332
1333
1334
Leginon sessions can be catagorized into different projects. The projects are created
1335
and viewed trhough a set of web tools. To access them, install the tools on the web server.
1336
The same project management tools are also used to create and track appion processing
1337
databases. If you want to use our processing pipeline, Appion, in the future, you must
1338
install this.
1339
1340
1341 16 Amber Herold
1342 11 Amber Herold
h2. Prerequisites for project tools
1343
1344
1345
1346
installed dbemtools and its prerequisites
1347
1348
1349
1350
1351 16 Amber Herold
1352 11 Amber Herold
h2. project tools
1353
1354
1355
Current release: project 1.2.
1356
1357
1358
1359
1360 15 Amber Herold
*  Download project tools from "http://emg.nysbc.org/software/dbemtools":http://emg.nysbc.org/software/dbemtools .
1361 11 Amber Herold
1362
1363
*  Unpack the package in your [webdirectory]
1364
1365 1 Eric Hou
1366 11 Amber Herold
1367
<pre>&gt;cd [webdirectory]			#/var/www/html in this example
1368
[webdirectory]&gt;tar zxvf project_1_2.tgz</pre>
1369
1370
1371
1372 1 Eric Hou
*  Go to the uncompressed directory
1373 17 Amber Herold
project_1_2.<pre>> cd project_1_2</pre>
1374 11 Amber Herold
1375
1376 19 Amber Herold
* Copy config.php.template to _config.php_
1377 11 Amber Herold
1378
1379
1380
<pre>> cp config.php.template to config.php</pre>
1381
1382
1383
1384 19 Amber Herold
* Edit _config.php_: You need to insert these MySQL
1385 11 Amber Herold
parameters in project tool's config.php
1386
1387
1388
1389 1 Eric Hou
<pre>// --- Project Configuration --- //
1390 11 Amber Herold
1391
// --- Leginon database config
1392
$DBEM_PATH="../dbem_1_5_1/";
1393
1394
$DB_HOST  = "[your database host]";
1395
$DB_USER  = "usr_object";
1396 1 Eric Hou
$DB_PASS  = "";
1397 11 Amber Herold
$DB   = "<link linkend="db_example_names">dbemdata</link>";
1398
1399
// --- Project database config
1400
$PROJECT_DB_HOST = "[your database host]";
1401 1 Eric Hou
$PROJECT_DB_USER = "<link linkend="db_example_names">usr_object</link>";
1402 11 Amber Herold
$PROJECT_DB_PASS = "";
1403
$PROJECT_DB = "<link linkend="db_example_names">projectdata</link>";
1404
</pre>
1405
1406
1407
1408
*  Test the set-up by visiting http://yourhost/project_1_2
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419 16 Amber Herold
1420 11 Amber Herold
h2.  Other Tools
1421
1422
1423
This section includes tools that may help with Leginon development.
1424
1425
1426 16 Amber Herold
1427 11 Amber Herold
h2.  phpMyAdmin
1428
1429
1430
1431
1432
1433 16 Amber Herold
*  Download phpMyAdmin from Yast2 or "www.phpmyadmin.net":http://www.phpmyadmin.net *  Download phpMyAdmin into the directory where the web server has been
1434 11 Amber Herold
installed.
1435
1436
1437
1438
1439
1440
1441
*  Check phpMyAdmin installation:
1442
1443
1444
1445
<pre>&gt;rpm -qa |grep -i phpmyadmin </pre>
1446
1447
1448
1449
*  Install from tarball:
1450
1451
1452
1453
<pre>> cd [webdirectory]
1454
[webdirectory]&gt;tar zxvf phpMyAdmin-2.x.tar.gz</pre>
1455
1456
1457
1458
or Install with yum if availabe:
1459
1460
1461
1462
<pre>> yum install phpMyAdmin</pre>
1463
1464
1465
1466
*  Create phpMyAdmin configuration file called config.inc.php from a
1467
sample.
1468
1469
1470
1471
<pre>[webdirectory]&gt;cd phpMyAdmin
1472
(if you install with yum, the program directory is /usr/share/phpMyAdmin)
1473
1474
> cp config.sample.inc.php config.inc.php
1475
</pre>
1476
1477
1478
1479
*  Make sure these are set correctly in <emphasis role="bold"
1480
>config.inc.php</emphasis>. Note that these are for MySQL which we set earlier.
1481
You can set specific user, but it is safer just leave it blank.
1482
1483
1484
1485
<pre>
1486
$cfg['Servers'][$i]['host']            = '[your host]';
1487
$cfg['Servers'][$i]['port']            = '';
1488
$cfg['Servers'][$i]['socket']          = '';
1489
$cfg['Servers'][$i]['connect_type']    = 'tcp';
1490
$cfg['Servers'][$i]['extension']       = 'mysql';
1491
$cfg['Servers'][$i]['compress']        = FALSE;
1492
$cfg['Servers'][$i]['controluser']     = '';
1493
$cfg['Servers'][$i]['auth_type']     = 'http';
1494
$cfg['Servers'][$i]['user']          = '';
1495
$cfg['Servers'][$i]['password']      = '';
1496
</pre>
1497
1498
1499
1500
*  For additional security, you may restrict mysql root access
1501
1502
1503
1504
<pre>
1505 1 Eric Hou
$cfg['Servers'][$i]['AllowRoot']     = FALSE;
1506 11 Amber Herold
</pre>
1507
1508
1509
1510 1 Eric Hou
*  If you want to access phpMyAdmin from another computer, you can add it to its
1511 11 Amber Herold
web access configuration file found as /etc/httpd/conf.d/phpMyAdmin.conf in a
1512
typical installation
1513
1514
1515 1 Eric Hou
1516 11 Amber Herold
<pre>
1517
&lt;Directory /usr/share/phpMyAdmin/>
1518
order deny,allow
1519
deny from all
1520
allow from 127.0.0.1
1521
allow from YOUR_IP_ADDRESS
1522
&lt;/Directory>
1523
</pre>
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537 16 Amber Herold
1538 11 Amber Herold
h2.  Windows installation
1539
1540
1541
1542 16 Amber Herold
1543 11 Amber Herold
h2.  Processing-side Leginon Windows Installation
1544
1545
1546
1547 16 Amber Herold
1548 11 Amber Herold
h2.  Install Python and Support Packages (Note that python 2.5 must be used):
1549
1550
1551
1552
This list does not include pyton XML module because it is included in the python
1553
package for window.
1554
1555 1 Eric Hou
1556 11 Amber Herold
1557 14 Amber Herold
|_.Name:|_.Download site:|
1558 11 Amber Herold
|Python 2.5*|"http://www.python.org":http://www.python.org |
1559 15 Amber Herold
|Python for Windows extension (pywin32) |"http://sourceforge.net/projects/pywin32/":http://sourceforge.net/projects/pywin32/ |
1560
|wxPython 2.5.2.8 or newer|"http://www.wxpython.org":http://www.wxpython.org |
1561
|MySQL Python client 1.2 or newer|"http://sourceforge.net/projects/mysql-python":http://sourceforge.net/projects/mysql-python |
1562
|Python Imaging Library (PIL) 1.1.4 or newer|"http://www.pythonware.com/products/pil/":http://www.pythonware.com/products/pil/ |
1563
|NumPy 1.0b5 (tested, others may work)|"http://www.scipy.org":http://www.scipy.org |
1564
|SciPy 0.5.1 or newer|"http://www.scipy.org":http://www.scipy.org |
1565
|Tortoise SVN client|"http://tortoisesvn.tigris.org":http://tortoisesvn.tigris.org |
1566
1567 11 Amber Herold
1568
1569 1 Eric Hou
1570 11 Amber Herold
*Python 2.5 is the only python version that we have compiled numExtension. libCV and
1571
comarray in. Therefore no other python version works for now.
1572
1573
1574
Execute the installer file and follow the directions.
1575
1576
1577
1578 1 Eric Hou
1579 16 Amber Herold
1580 11 Amber Herold
h2. Packages required from NRAMM
1581
1582
1583
1584
Here are the packages you need to install with python installer
1585
1586 1 Eric Hou
1587 11 Amber Herold
1588 14 Amber Herold
|_.Name:|_.Purpose:|
1589 11 Amber Herold
| Leginon|modular TEM image acquisition|
1590
| pyami|general functions|
1591
| sinedon|Leginon/database interaction|
1592
| pyScope|microscope control and monitoring|
1593
| ImageViewer|image viewing for tomography|
1594
1595
1596
1597
1598
Because numextension and libCV requires extra compilers, we have created window
1599 1 Eric Hou
installer for them for python 2.5 and made them available through "http://www.leginon.org/":http://www.leginon.org/
1600
1601 14 Amber Herold
|_.Downloadfile Name|_.Installed Python Package File|_.Purpose:|
1602 13 Amber Herold
|NumExtension-1.2.0.win32-py2.5.exe|numextension.pyd|c extension for numerical processing|
1603 11 Amber Herold
|libCV-0.2.win32-py2.5.exe|libCV.pyd|small c library of algorithm from computer vision field|
1604
1605
1606 1 Eric Hou
1607 11 Amber Herold
1608
1609
1610 16 Amber Herold
1611 11 Amber Herold
h2. Check out SVN Source Files from the depository
1612
1613
1614
1615
Use your mouse to do the following
1616
* Create Leginon-1.6-ALL directory somewhere at your convenience
1617
1618
1619
* Change directory into Leginon-1.6-ALL
1620
1621 1 Eric Hou
1622 11 Amber Herold
* Right-click the mouse botton in this directory window and select Tortoise svn
1623 17 Amber Herold
Checkout in the menu:!http://emg.nysbc.org/software/leginon/images/images/svnmenu.png!
1624 1 Eric Hou
1625 11 Amber Herold
1626
* Set up svn checkout window like this for <link linkend="windows_packages">EACH
1627 17 Amber Herold
of the leginon packages</link>.!http://emg.nysbc.org/software/leginon/images/images/svnco.png!
1628 11 Amber Herold
1629
1630 1 Eric Hou
1631 11 Amber Herold
1632
1633
1634
1635 16 Amber Herold
1636 11 Amber Herold
h2. Install the packages you downloaded from NRAMM svn depository
1637
1638 1 Eric Hou
1639 11 Amber Herold
1640
1641
1642
* Start a command line Window from Start Menu
1643
1644
1645
* Install the package in each folder with commands such as
1646
<pre>cd Your_Download_Place\Leginon-1.6-ALL\leginon
1647
c:\\python25\python.exe setup.py install</pre>
1648
1649
1650
1651
1652
1653
1654
1655
1656 16 Amber Herold
1657 11 Amber Herold
h2. Download the two Window Installer Files from Leginon website
1658
1659
1660
1661
"http://www.leginon.org/":http://www.leginon.org/ h2. Install individual packages
1662 15 Amber Herold
1663 11 Amber Herold
1664
1665
Excute the installer files and follow the instruction.
1666
1667
1668
1669
1670 16 Amber Herold
1671 11 Amber Herold
h2.  Mapping Drives:
1672
1673
1674
1675
If you plan to run Leginon directly on the Windows machine, such as in <link
1676
linkend="config_C">configuration C</link>, and your data files are served through a
1677
Samba server on a Linux machine, you will need to map the network drive. For example, if
1678
your Samba server has a hostname your_smbserver, and you have set up a share called
1679
[your_share_point] which points to /your_data_path/ and leginon data will be saved under a
1680
folder in /your_data_path/leginon/
1681 1 Eric Hou
1682 11 Amber Herold
1683
1684
1685
*  Start, My Computer
1686 1 Eric Hou
1687 11 Amber Herold
1688
*  Tools menu, Map network drive
1689 1 Eric Hou
1690 11 Amber Herold
1691
*  Use an unmapped drive such as Z:
1692
1693 1 Eric Hou
Enter shared path in Windows format
1694 17 Amber Herold
as<pre>\\your_smbserver\your_share_point</pre>
1695 11 Amber Herold
1696
1697
*  Add the drive and the Linux path to leginon.cfg on the Windows machine
1698 17 Amber Herold
as<pre>[Drive Mapping]
1699 11 Amber Herold
Z:/your_data_path</pre>
1700
1701
1702
*  Add image path to leginon.cfg on the Windows machine in Linux format
1703 17 Amber Herold
as<pre>[Images]
1704 11 Amber Herold
path:/your_data_path/leginon</pre>
1705
1706
1707
1708
1709
1710
1711
1712
1713 16 Amber Herold
1714 11 Amber Herold
h2.  Configure leginon.cfg:
1715
1716
1717
Follow instruction in "<link linkend="leginon_cfg">Configure leginon.cfg</link>" in
1718
the section for Linux installation but note the location of the configuration files
1719
follows. In addition, if the storage disk is mapped onto the Windows PC as drive Z, this
1720
mapping should be included in leginon.cfg. See above.
1721
1722
1723
1724
1725
*  Configurations for all users
1726
1727
1728
1729 1 Eric Hou
<pre> &lt;Python directory&gt;\Lib\site-packages\Leginon\config\leginon.cfg</pre>
1730 11 Amber Herold
1731
1732
Example:
1733
<pre> C:\Python25\Lib\site-packages\Leginon\config\leginon.cfg</pre>
1734
1735
1736
*  Configurations for individual users
1737
1738
1739
1740
<pre> &lt;Home directory&gt;\leginon.cfg</pre>
1741
1742
1743
Example:
1744
<pre> C:\Documents and Settings\Leginon User\leginon.cfg </pre>
1745
1746
1747
*  A skeleton (default) configuration file is available:
1748
1749
1750
1751
<pre> C:\Python25\Lib\site-packages\Leginon\config\default.cfg</pre>
1752
1753
1754
1755
1756
1757
1758
1759
1760 1 Eric Hou
1761 16 Amber Herold
1762 11 Amber Herold
h2.  Configure sinedon.cfg:
1763
1764
1765
Sinedon is designed to be able to interact with multiple databases.
1766
1767
Follow instruction in "<link linkend="sinedon_cfg">Configure sinedon.cfg</link>" in
1768
the section for Linux installation but note the location of the configuration files
1769
follows.
1770
1771
1772
1773
1774
* For all users, put sinedon.cfg with the installed package
1775
as<pre>C:\Python25\Lib\site-packages\sinedon\sinedon.cfg</pre>
1776
1777
1778
*  Your home directory on
1779
Windows:<pre>C:\Documents and Settings\your_name&gt;</pre>
1780
1781
1782
* the skeleton sinedon configuration file
1783
is<pre>C:\Python25\Lib\site-packages\sinedon\examples\sinedon.cfg</pre>
1784
1785
1786
1787
1788
1789
1790
1791
1792 16 Amber Herold
1793 11 Amber Herold
h2.  Create Leginon and Leginon Client shortcut in Start menu menu under Leginon
1794
1795
1796 1 Eric Hou
1797 11 Amber Herold
This instruction refers to Windows XP
1798
1799
1800
1801
1802
* Go to C:\Documents and Settings\All Users\Start Menu\Programs\ and create a new
1803 1 Eric Hou
folder named Leginon.
1804 11 Amber Herold
1805
1806
* In another window, go
1807 17 Amber Herold
to<pre>C:\Python25\Lib\site-packages\Leginon</pre>
1808 11 Amber Herold
1809
1810 1 Eric Hou
* Create a shortcut from start-leginon.py as Leginon and a shortcut from
1811 11 Amber Herold
launcher.py as Leginon Client.
1812
1813
1814
* Move the two shortcuts into
1815 17 Amber Herold
<pre>C:\Documents and Settings\All Users\Start Menu\Programs\Leginon</pre>
1816 11 Amber Herold
1817
1818
1819
1820
1821
1822
1823
1824 16 Amber Herold
1825 11 Amber Herold
h2.  Additional Software (Optional):
1826 1 Eric Hou
1827 11 Amber Herold
1828
TightVNC (http://www.tightvnc.com)
1829
1830
1831
1832
1833
1834
1835
1836
1837 16 Amber Herold
1838 11 Amber Herold
h2. Database server Windows Installation
1839
1840
1841
1842 16 Amber Herold
1843 11 Amber Herold
h2. We do not do this at NRAMM. Please follow the instruction in Linux installation and
1844
modify it for Windows at your own risk.
1845
1846
1847
1848
For a good Windows specific instruction for general PHP configuration with MySQL for
1849
Apache 2 in Windows, try http://www.artfulsoftware.com/php_mysql_win.html.
1850
1851
1852
1853
1854
1855
1856
1857
1858 16 Amber Herold
1859 1 Eric Hou
h2.  Additional installation on the microscope computer:
1860 11 Amber Herold
1861
1862
1863
The full leginon and its supporting packages need to be installed on the Windows computer
1864
controlling the microscope. Additional programs are required for communication with the CCD
1865
and extra functions for Tecnai scripting not supported as default by FEI Tecnai
1866
microscopes
1867
1868
1869 16 Amber Herold
1870 11 Amber Herold
h2.  Required supporting programs for the CCD camera from camera makers
1871
1872
1873
1874
Install and register the following programs for CCD cameras from the two makes:
1875
1876 1 Eric Hou
1877
1878 14 Amber Herold
|_.Camera Make:|_.File:|
1879 11 Amber Herold
| Gatan|TecnaiCCD.dll|
1880
| Tietz|CAMC4.exe*|
1881
1882
1883
1884
1885
* We have experienced slowness of the CAMC4.exe comes with later version Tecnai TUI/TIA.
1886
Replacing it with an earlier version of CAMC4.exe resolved the problem.
1887
1888
1889
1890
1891 16 Amber Herold
1892 11 Amber Herold
h2. Additional Package required from NRAMM for Gatan camera or camera that uses TIA
1893
1894
1895
1896
For Gatan Camera or FEI Eagle Camera that uses TIA, comarray package need to be install
1897 1 Eric Hou
with python
1898 11 Amber Herold
1899 1 Eric Hou
1900
1901
|_.SVN Package Name|_.Installed Python Package Name|_.Reason for update:|
1902 11 Amber Herold
|comarray|comarray|com module output conversion to array|
1903
1904
1905
1906
1907
1908
1909
* <link linkend="window_svn">Check out the comarray package</link> from svn
1910
depository with your SVN client
1911
1912 17 Amber Herold
<pre>cd Leginon-1.6-ALL
1913 11 Amber Herold
svn co http://emg.nysbc.org/svn/comarray/branches/leg1.6 comarray</pre>
1914
1915
* Start a command line Window from Start Menu
1916 1 Eric Hou
1917 11 Amber Herold
1918
* Install the package with commands such as
1919
<pre>cd Your_Download_Place\Leginon-1.6-ALL\comarray
1920
c:\\python25\python.exe setup.py install</pre>
1921
1922
1923
1924
1925
1926
1927
1928
1929 16 Amber Herold
1930 11 Amber Herold
h2.  Supporting programs for film exposure
1931
1932
1933
1934
Install the following if you need film exposure on FEI Tecnai TEM through Leginon,
1935
available through FEI. Please contact Max Otten: <email>mto@feico.com</email> and request
1936 1 Eric Hou
for adaexp.exe that works with your version of Tecnai user interface program.
1937
1938 11 Amber Herold
1939 14 Amber Herold
1940 13 Amber Herold
|_.Name:|_.File:|
1941 11 Amber Herold
| exposure adaptor|adaexp.exe|
1942
1943
1944
1945
1946
1947
1948 16 Amber Herold
1949 11 Amber Herold
h2.  Register adaexep.exe
1950
1951
1952
1953
*  From the command prompt:
1954
1955
<pre>adaexp.exe /regserver</pre>
1956
1957
*  From the program start menu under pyScope or
1958
C:\Python25\Lib\site-packages\pyScope\
1959
1960
<pre>updatecom.py</pre>
1961
1962
1963
1964
1965
1966
1967
1968 16 Amber Herold
1969 11 Amber Herold
h2. Modify instruments.cfg:
1970
1971 1 Eric Hou
1972 11 Amber Herold
1973
Sinedon now have full control of database interaction, therefore, the database
1974
configuration in leginon.cfg is no longer needed.
1975
1976
1977
1978
1979
* Modify the file instruments.cfg in the installed pyScope directory to that for
1980
your microscope and camera. For example, if your microscope uses Tecnai Scripting
1981
Interface and you have a Gatan camera that you interface through
1982
DigitalMicrograph:
1983
1984
1985
1986
<pre>[tem]
1987
class: tecnai.Tecnai
1988
[camera]
1989
class: gatan.Gatan</pre>
1990
1991 1 Eric Hou
1992 11 Amber Herold
1993
The file contains other examples of microscope and camera drivers that we
1994
distribute from NRAMM.
1995
1996
1997
1998
1999
2000
2001
2002
2003 16 Amber Herold
2004 11 Amber Herold
h2. Run updatecom.py
2005
2006
2007
2008
From a command line window:
2009
2010
2011
2012
<pre>cd C:\python25\Lib\Site-Packages\pyScope
2013
C:\python25\python.exe updatecom.py</pre>
2014
2015
2016
2017
This should generate a few files, including tecnaicom.py, gatancom.py and tietzcom.py,
2018
in the same directory.
2019
2020
2021
2022
2023 16 Amber Herold
2024 11 Amber Herold
h2. Additional setup on Tietz PXL camera (optional)
2025
2026
2027
2028
The actual Tietz PXL camera dimension is slightly larger than 2048 x 2048. If you'd like
2029
to take the images using the maximum of 2048 x 2048 pixels, you may modify the function that
2030
get camera dimension in tietz.py of pyScope package.
2031
2032 1 Eric Hou
2033 11 Amber Herold
*  Go to C:\Python25\Lib\site-packages\pyScope\
2034
2035
2036
*  Edit tietz.py with a plain text editor
2037
2038
2039
*  Find the lines:
2040
2041
2042
2043
<pre> def getCameraSize(self):
2044
# {'type': dict, 'values': {'x': {'type': int}, 'y': {'type': int}}}}
2045
x = self._getParameterValue('cpTotalDimensionX')
2046 1 Eric Hou
y = self._getParameterValue('cpTotalDimensionY')
2047 11 Amber Herold
return {'x': x, 'y': y}
2048
</pre>
2049
2050
2051 1 Eric Hou
2052 11 Amber Herold
*  Change the last line to:
2053
2054
2055
2056
<pre>    return {'x': 2048, 'y': 2048}</pre>
2057
2058
2059
2060
2061 1 Eric Hou
2062 11 Amber Herold
2063
2064 16 Amber Herold
2065 11 Amber Herold
h2.  Additional Software (Optional):
2066
2067
2068
TightVNC (http://www.tightvnc.com) if you get tired of going into the microscope room
2069
just to open the column valves.
2070 1 Eric Hou
2071 11 Amber Herold
2072
2073
2074
2075
2076
2077
2078 16 Amber Herold
2079 11 Amber Herold
h2.  What is next
2080
2081 1 Eric Hou
2082 11 Amber Herold
2083 16 Amber Herold
2084 11 Amber Herold
h2.  Perform Administration Setup
2085
2086 1 Eric Hou
2087 11 Amber Herold
See Next chapter on <link linkend="addusers">Leginon Administration Tools</link>.
2088
2089
2090
2091 1 Eric Hou
2092 11 Amber Herold
2093 16 Amber Herold
2094 11 Amber Herold
h2.  Create a test project
2095
2096
2097
See the chapter on <link linkend="project">Project Management Tools</link>.
2098
2099
2100
2101 1 Eric Hou
2102 16 Amber Herold
2103 11 Amber Herold
h2.  Perform Microscope Setup and Test run
2104
2105
2106
See the chapter on <link linkend="runleg_chapter">Start Leginon</link>.
2107
2108
2109
2110
2111
2112 1 Eric Hou
2113 16 Amber Herold
2114 11 Amber Herold
h2.  Backup Practices
2115
2116
2117
2118 16 Amber Herold
2119 11 Amber Herold
h2.  Ideal setup:
2120
2121
2122
2123 16 Amber Herold
2124 11 Amber Herold
h2.  Regular computer backup
2125 1 Eric Hou
2126 11 Amber Herold
2127
2128
To protect your program installation.
2129
2130
2131
2132
2133 16 Amber Herold
2134 11 Amber Herold
h2.  Full backup of the databases every night
2135 1 Eric Hou
2136 11 Amber Herold
2137
2138
The database is the metadata generated by Leginon named "dbemdata" in the installation
2139
example.
2140
2141
2142
2143
2144 16 Amber Herold
2145 11 Amber Herold
h2. Full/Incremental/differential backup of the images
2146
2147
2148 1 Eric Hou
2149 11 Amber Herold
The image files located in [your storage disk] should be backup in full at least once
2150
a month, and nightly in differential or incremental mode.
2151
2152
2153
2154
2155 1 Eric Hou
2156 11 Amber Herold
2157 16 Amber Herold
2158 11 Amber Herold
h2.  Current NRAMM setup:
2159
2160
2161
2162
Because our tape backup system is not on-site and the data have to transfer over slow
2163
network to perform the task, we have not been able to backup in the ideal setting. Here is
2164
what we currently do:
2165
2166
2167 16 Amber Herold
2168 11 Amber Herold
h2.  Regular computer backup
2169
2170
2171
2172
TSRI Research Computing provides regular back up service that does full backup of the
2173
computers every four weeks and incremental backup every night. The full backup expires in
2174
4 months and the incremental backup one month. We do this for the computers running
2175
Leginon main program, the database server, as well as the web server.
2176
2177
2178
2179
2180 16 Amber Herold
2181 11 Amber Herold
h2.  Regular backup &amp; tar of the databases every night
2182
2183
2184
2185
On top of the TSRI backup, we also tar the database everynight and store it on the
2186
institutional tape library.
2187 16 Amber Herold
2188 11 Amber Herold
2189
2190
2191
2192
h2.  rsync to a tape library of the image storage disk
2193
2194
2195
2196
As our image storage disks total 15T byte, we currently use rsync function to update a
2197
copy on our institutional tape library. It creates new files, updates old files, but does
2198
not remove old files on the tape if it is removed on the storage disk. We do not think
2199
this is the best solution since it is not possible to retrieve old files that have been
2200
modified on a later time.