Project

General

Profile

Appion Home » History » Version 27

Amber Herold, 04/01/2010 11:02 AM

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