Project

General

Profile

Start with existing CentOS installation » History » Version 32

Amber Herold, 03/08/2010 05:07 PM

1 25 Amber Herold
h1. Start with existing CentOS 5.3 64-bit installation
2 5 Amber Herold
3
{{>toc}}
4 1 Amber Herold
5 13 Amber Herold
h2. 3 Download additional software 
6 2 Amber Herold
7 13 Amber Herold
h3. 3.1 Install the additional package repositories 
8 2 Amber Herold
9
*NOTE*
10
11
There are several additional CentOS repositories that you can install.
12
These repositories provide additional packages, such as patented software (MP3 players),
13
closed source applications (Flash plugin, Adobe Acrobat Reader)
14
and lesser used packages (python numpy, Gnu Scientific Library).
15
But some repositories install packages over other packages,
16
which can cause problems and conflicts (ATrpms is bad at this). So I recommend only installing
17
EPEL and RPM Fusion. Read more here:
18
"CentOS Additional Repositories":http://wiki.centos.org/AdditionalResources/Repositories 
19
20 13 Amber Herold
h4. 3.1.1 Extra Packages for Enterprise Linux (EPEL) 
21 2 Amber Herold
22 12 Amber Herold
* http://fedoraproject.org/wiki/EPEL
23
* contains a wealth of packages required for appion
24 2 Amber Herold
25
.Download repository rpm and install
26
27
<pre>
28
$ sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/`uname -i`/epel-release-5-3.noarch.rpm
29
</pre>
30 1 Amber Herold
31 13 Amber Herold
h4. 3.1.2 RPM Fusion 
32 2 Amber Herold
33 12 Amber Herold
* http://rpmfusion.org/
34
* good for mp3 and other patent limited software
35 2 Amber Herold
36
.Download repository rpms and install
37
38
<pre>
39
$ sudo rpm -Uhv http://download1.rpmfusion.org/free/el/updates/testing/5/`uname -i`/rpmfusion-free-release-5-0.1.noarch.rpm
40
$ sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/el/updates/testing/5/`uname -i`/rpmfusion-nonfree-release-5-0.1.noarch.rpm
41
</pre>
42
43 13 Amber Herold
h3. 3.2 Update current packages 
44 2 Amber Herold
45
.Update the updater to make life easier
46
47
<pre>
48
$ sudo yum -y update yum
49
</pre>
50
51
.Update all packages
52
53 1 Amber Herold
<pre>
54
$ sudo yum -y update
55
</pre>
56
57
*NOTE*
58 2 Amber Herold
Download was over 129 MB (in July 2009). If you have a slow internet connection you can setup presto/deltarpms, "see this email]":http://www.linux-archive.org/centos-development/222706-presto-deltarpm.html 
59 18 Amber Herold
You may want to restart your computer when this completes.
60 2 Amber Herold
61 19 Amber Herold
h4. .Install Complete list of additional packages:
62 2 Amber Herold
63 12 Amber Herold
* *python tools*: python-tools python-devel
64
* *general applications*: subversion ImageMagick grace gnuplot python-matplotlib
65
* *Tilt Picker*: wxPython numpy scipy python-imaging
66
* *FindEM*: gcc-gfortran compat-gcc-34-g77
67
* *Ace 2*: gcc-objc fftw3-devel gsl-devel
68
* *Sinedon*: mysql mysql-server MySQL-python
69
* *DBEM*: httpd php php-mysql phpMyAdmin
70
* *Xmipp MPI*: gcc-c++ openmpi-devel libtiff-devel
71
* *MRC tools*: php-devel gd-devel re2c fftw2-devel php-gd
72
* *UCSF Chimera imaging*: xorg-x11-server-Xvfb
73 2 Amber Herold
74
<pre>
75
$ sudo yum -y install \
76
python-tools python-devel python-matplotlib \
77
subversion ImageMagick grace gnuplot \
78
wxPython numpy scipy python-imaging \
79
gcc-gfortran compat-gcc-34-g77 \
80
gcc-objc fftw3-devel gsl-devel \
81
mysql mysql-server MySQL-python \
82
httpd php php-mysql phpMyAdmin  \
83
gcc-c++ openmpi-devel libtiff-devel \
84
php-devel gd-devel re2c fftw2-devel php-gd \
85
xorg-x11-server-Xvfb
86
</pre>
87
88
If you have an nVidia video card and setup RPM fusion, install the nVidia binary, will speed things up especially for UCSF Chimera
89
90
<pre>
91
$ sudo yum -y install nvidia-x11-drv
92
</pre>
93
94
.Clean up packages to save drive space
95
96
<pre>
97
$ sudo yum clean all
98
</pre>
99
100
.Re-index the hard drive, this will come in handy later
101
102 1 Amber Herold
<pre>
103 2 Amber Herold
$ sudo updatedb
104
</pre>
105
106
.Enable servers on reboot
107
108
<pre>
109
$ sudo /sbin/chkconfig httpd on
110
</pre>
111
112
<pre>
113
$ sudo /sbin/chkconfig mysqld on
114
</pre>
115
116
You can further configure this with the GUI and turn off unnecessary items
117
118
<pre>
119
$ system-config-services
120
</pre>
121
122
.Reboot the computer
123 1 Amber Herold
124 2 Amber Herold
<pre>
125
$ sudo reboot
126
</pre>
127 1 Amber Herold
128 24 Amber Herold
----
129
130 28 Amber Herold
h2. 4 MRC PHP Extension Installation and Testing
131 13 Amber Herold
132 28 Amber Herold
h3. 4.1 Build the MRC module
133 20 Amber Herold
134 1 Amber Herold
Download "php_mrc_src_1_5_1.tgz":http://emg.nysbc.org/software/dwd.php?id=N1HDb4ac22efb5b38b05fd3575d42d3e4adc2
135 27 Amber Herold
136
h4. cd to your php devel directory
137 23 Amber Herold
138 30 Amber Herold
<pre>
139 31 Amber Herold
> cd /usr/include/php/ext/
140
> mv [downloads]/php_mrc_src_1_5_1.tgz .
141 30 Amber Herold
</pre>
142 1 Amber Herold
143
h4. Untar the archive
144
145 30 Amber Herold
<pre>
146 32 Amber Herold
> tar zxvf php_mrc_src_1_5_1.tgz
147
> cd mrc/
148 30 Amber Herold
</pre>
149 1 Amber Herold
150 23 Amber Herold
h4. Make sure that GD and FFTW 3 devel libraries are installed
151
152 30 Amber Herold
<pre>
153 32 Amber Herold
> phpize
154
> ./configure 
155
> make
156
> make install
157 30 Amber Herold
</pre>
158 1 Amber Herold
159 28 Amber Herold
h3. 4.2 Install MRC module
160 23 Amber Herold
161 30 Amber Herold
h4.  Check that mrc.so is in your php extension directory
162 1 Amber Herold
163 30 Amber Herold
<pre>
164 32 Amber Herold
> ls /usr/lib/php/extensions
165 30 Amber Herold
</pre>
166 23 Amber Herold
167 30 Amber Herold
You should see mrc.so listed.
168
169 1 Amber Herold
h4. Make sure that GD and FFTW 3 libraries are installed
170
171
* edit your  php configuration file php.ini to add "mrc.so" extension.
172
* You might also increase the memory_limit field. It is set to 8M by default. The more the merrier!
173
* 4kx4k float MRC image is about 64MB
174 30 Amber Herold
<pre>
175 32 Amber Herold
> vi /etc/php.ini
176 30 Amber Herold
</pre>
177 24 Amber Herold
178 23 Amber Herold
* increase memory
179
<pre>
180 32 Amber Herold
> memory_limit = 256M; Maximum amount of memory
181 25 Amber Herold
</pre>
182 28 Amber Herold
183 29 Amber Herold
* Create the mrc.ini file
184
185 30 Amber Herold
<pre>
186 32 Amber Herold
> cd /etc/php.d
187 30 Amber Herold
vi mrc.ini
188
</pre>
189
190 32 Amber Herold
* add the following lines
191 1 Amber Herold
192
<pre>
193 23 Amber Herold
 ; Enable mrc extension module
194 1 Amber Herold
 extension=mrc.so
195
</pre>
196
197 32 Amber Herold
*NOTE:* If PHP modules are already listed in PHP.ini do the following:
198
199 23 Amber Herold
* check extension_dir value
200 1 Amber Herold
<pre>
201
 extension_dir = /usr/lib64/php/extensions
202
</pre>
203
204 32 Amber Herold
* add the following at the end of the [extension section]
205 1 Amber Herold
206
extension=mrc.so
207 23 Amber Herold
208
h4. restart your webserver
209 25 Amber Herold
210 30 Amber Herold
<pre>
211
/etc/init.d/apache2 restart
212
</pre>
213 23 Amber Herold
214
OR
215
216 30 Amber Herold
<pre>
217
/etc/init.d/httpd restart
218
</pre>
219 2 Amber Herold
220
h3. 4.3 Test the MRC module installation
221 17 Amber Herold
222 2 Amber Herold
223 13 Amber Herold
----
224 2 Amber Herold
225 12 Amber Herold
h2. 5 Compile and setup Appion python programs 
226 2 Amber Herold
227 12 Amber Herold
h3. 5.1 Compile FindEM 
228 2 Amber Herold
229
* Goto pyappion/findem folder to make findem.exe
230
231
* Compile the libraries and binary
232
233 12 Amber Herold
<pre>
234 2 Amber Herold
$ make
235
</pre>
236
237
* Test findem.exe to see if it runs
238
239
<pre>
240
$ make test
241
</pre>
242
243 11 Amber Herold
*WARNING*
244 2 Amber Herold
Only if the first part fails, you must add the path to libg2c.so library file.
245
Otherwise skip to next section.
246
247
* locate libg2c.so library file
248
249 1 Amber Herold
<pre>
250 2 Amber Herold
$ ls /usr/lib/gcc/`uname -i`-redhat-linux/3.4.6/libg2c.so
251
</pre>
252
253 1 Amber Herold
<pre>
254 2 Amber Herold
$ locate libg2c.so
255
</pre>
256
257
* Edit Makefile with location of libg2c.so
258 1 Amber Herold
259 11 Amber Herold
<pre>
260
$ nano Makefile
261 2 Amber Herold
</pre>
262 13 Amber Herold
263 2 Amber Herold
* Example: EXLIBS=-L/usr/lib/gcc/i386-redhat-linux/3.4.6/ -lg2c
264
* Re-compile
265
266
h3. 5.2 Compile Ace2 
267 1 Amber Herold
268 2 Amber Herold
*WARNING*
269 1 Amber Herold
ace2 typically requires fftw 3.2 or greater, but you can remove the FFTW_WISDOM_ONLY flag in Image.m
270 11 Amber Herold
271 1 Amber Herold
*NOTE*
272 11 Amber Herold
64 bit binaries are included with pyappion
273 2 Amber Herold
274
* Goto pyappion/ace2
275
* compile the libraries and binary
276
* test to see if program runs
277 1 Amber Herold
278 2 Amber Herold
<pre>
279
$ make
280
$ ./ace2.exe -h
281 13 Amber Herold
$ ./ace2correct.exe -h
282 2 Amber Herold
$ mv -v ./ace2*.exe ../bin
283 11 Amber Herold
</pre>
284 2 Amber Herold
285 11 Amber Herold
h3. 5.3 Compile Radermacher module 
286 1 Amber Herold
287 2 Amber Herold
* Goto pyappion/radermacher
288 1 Amber Herold
289 2 Amber Herold
* compile the libraries and binary
290
291 11 Amber Herold
<pre>
292 2 Amber Herold
$ python ./setup.py build
293
</pre>
294
295
* install module globally
296
297 1 Amber Herold
<pre>
298 2 Amber Herold
$ sudo python ./setup.py install
299
</pre>
300
301
* test installed module
302
303
<pre>
304
$ python
305
</pre>
306
307
<pre>
308 13 Amber Herold
>>> import radermacher
309 2 Amber Herold
>>> <Ctrl-D>
310 11 Amber Herold
</pre>
311
312 2 Amber Herold
h3. 5.4 Test PyAppion 
313
314
* Go into pyappion directory
315
* Add leginon to PYTHONPATH if Leginon is built locally
316
317 11 Amber Herold
<pre>
318 2 Amber Herold
$ export PYTHONPATH="$LEGINONPATH:$PYTHONPATH"
319
</pre>
320
321
* Add pyappion lib to PYTHONPATH
322 1 Amber Herold
323
<pre>
324 2 Amber Herold
$ export PYTHONPATH="/your-complete-path-to-pyappion/lib:$PYTHONPATH"
325
</pre>
326
327
* Run the test script
328
329
<pre>
330
$ ./check.sh
331
</pre>
332
333
*NOTE*
334 13 Amber Herold
You can ignore EMAN, MATLAB, and UCSF Chimera errors at this point
335 2 Amber Herold
336 13 Amber Herold
----
337 2 Amber Herold
338
h2. 6 Setup MySQL (appiondata) databases 
339
340
Refer to [[Start_with_existing_ANY_Linux_flavor_OS#2-Setup-MySQL-databases|Setup MySQL databases]]
341
342
h3. Configure MySQL 
343
344
Edit the configuration file:
345
346
<pre>
347
$ sudo nano /etc/my.cnf
348
</pre>
349
350
Add or edit the following lines:
351
352
<pre>
353
query_cache_type = 1
354
query_cache_size = 100M
355
query_cache_limit= 100M
356
</pre>
357
358
Restart MySQL
359
360
<pre>
361
$ sudo /sbin/service mysqld restart
362
</pre>
363
364
h3. Configure phpMyAdmin 
365
366
Edit the phpMyAdmin config file:
367
368
<pre>
369
$ sudo nano /etc/phpMyAdmin/config.inc.php
370
</pre> 
371
372
and change the following lines:
373
374
<pre>
375 1 Amber Herold
$cfg['Servers'][$i]['AllowRoot']     = FALSE;
376
</pre>
377 2 Amber Herold
378
Edit the phpMyAdmin apache config file:
379
380
<pre>
381
$ sudo nano /etc/httpd/conf.d/phpMyAdmin.conf
382 1 Amber Herold
</pre>
383 2 Amber Herold
384
and change the following lines:
385
386
<pre>
387
<Directory /usr/share/phpMyAdmin/>
388
   order deny,allow
389
   deny from all
390
   allow from 127.0.0.1
391
   allow from YOUR_IP_ADDRESS
392
</Directory>
393 13 Amber Herold
</pre>
394 2 Amber Herold
395 14 Amber Herold
----
396 2 Amber Herold
397
h2. 7 Install webpages (appionweb)
398
399 1 Amber Herold
Refer to [[Start_with_existing_ANY_Linux_flavor_OS#3-Web-server-side-installation|Web server side installation]]
400 2 Amber Herold
401 13 Amber Herold
h3. Install MRC Tools 
402
403 2 Amber Herold
h4. Compile MRC tools 
404
405
* Go to your php devel directory and untar the archive
406
* If unsure where it is, use info.php to find it under *extension_dir*
407 1 Amber Herold
408 2 Amber Herold
<pre>
409
$ cd /usr/include/php/ext/
410 1 Amber Herold
$ sudo mkdir mrc
411 13 Amber Herold
$ sudo chmod 777 mrc
412 2 Amber Herold
$ sudo chown $USER mrc
413
</pre>
414
415
* Unpackage MRC Tools from http://emg.nysbc.org/software/mrctools/
416
417
<pre>
418 13 Amber Herold
$ tar zxvf ~/php_mrc.tgz
419 2 Amber Herold
$ cd mrc/
420
</pre>
421
422
* Compile and install the MRC module
423
424
<pre>
425 1 Amber Herold
$ phpize
426 2 Amber Herold
$ ./configure 
427
$ make
428
$ sudo make install
429 13 Amber Herold
</pre>
430 1 Amber Herold
431 2 Amber Herold
h4. Configure PHP for MRC Tools 
432
433 1 Amber Herold
* Edit your php configuration file php.ini to add "mrc.so" extension.
434 2 Amber Herold
435 13 Amber Herold
<pre>
436 2 Amber Herold
$ sudo nano /etc/php.d/mrc.ini
437
</pre>
438 1 Amber Herold
439 2 Amber Herold
* add mrc.so to extensions
440
441
<pre>
442 13 Amber Herold
; Enable mrc extension module
443 2 Amber Herold
extension=mrc.so
444
</pre>
445
446
* To test MRC tools, go to this website:
447 13 Amber Herold
http://emg.nysbc.org/software/mrctools/mrc_so.php
448 2 Amber Herold
449
h3. Configure PHP 
450
451
* increase the memory limit, EM images are big 64MB:
452
453 13 Amber Herold
<pre>
454 2 Amber Herold
memory_limit = 256M; Maximum amount of memory
455
</pre>
456
457
* Turn error display on:
458
459 1 Amber Herold
<pre>
460
display_errors = On
461
</pre>
462 2 Amber Herold
463 13 Amber Herold
<pre>
464 2 Amber Herold
error_reporting = E_ALL & ~E_NOTICE
465
</pre>
466
467
* restart the webserver
468
469
<pre>
470
$ sudo /sbin/service httpd restart
471 15 Amber Herold
</pre>
472 2 Amber Herold
473
h3. Install DBEM and project php source 
474
475
Please consult the other [[Start_with_existing_ANY_Linux_flavor_OS#3-Web-server-side-installation|Install guide]]
476
477 13 Amber Herold
h3. Configuration 
478 2 Amber Herold
479
h4. configure apache 
480
481
* allow REMOTE_HOST lookups in apache
482
483 13 Amber Herold
<pre>
484 2 Amber Herold
$ sudo nano /etc/httpd/conf/httpd.conf
485
</pre>
486
487
* turn _HostnameLookups_ to On
488
489 13 Amber Herold
<pre>
490 2 Amber Herold
HostnameLookups On
491
</pre>
492
493
* restart the webserver
494
495
<pre>
496 1 Amber Herold
$ sudo /sbin/service httpd restart
497 15 Amber Herold
</pre>
498 2 Amber Herold
499
h4. configure project_1_2, dbem_1_5_1, and dbem_1_5_1/processing 
500
501 16 Amber Herold
Please consult the other [[Start_with_existing_ANY_Linux_flavor_OS#3-Web-server-side-installation|Install guide]]
502 2 Amber Herold
503
h3. Initialize database tables from the web tools 
504
505
Please consult [[Start_with_existing_ANY_Linux_flavor_OS#4-Create-a-test-project-and-processing-database|Create a test project and processing database]]
506
507
h3. Potential problems 
508
509
h4. Firewall settings 
510
511
You may need to configure your firewall to allow incoming HTTP (port 80) and MySQL (port 3306) traffic:
512
513
<pre>
514
$ system-config-securitylevel
515
</pre>
516
517
h4. Security-enhanced linux 
518
519
"Security-enhanced linux (SELinux)":http://en.wikipedia.org/wiki/Security-Enhanced_Linux  may be preventing your files from loading. To fix this run the following command:
520
521
<pre>
522
$ sudo /usr/bin/chcon -R -t httpd_sys_content_t /var/www/html/
523
</pre>
524
525 13 Amber Herold
see "this website":http://docs.fedoraproject.org/selinux-apache-fc3/sn-simple-setup.html  for more details on SELinux
526
527 2 Amber Herold
----
528
529
h2. 8 Install external packages 
530
531 13 Amber Herold
*Please follow individual package installation instruction provided with them*
532
533
h3. Compile Xmipp for OpenMPI 
534 2 Amber Herold
535
* For more info, see http://xmipp.cnb.csic.es/twiki/bin/view/Xmipp/InstallingTheSoftware
536
* Go into Xmipp source directory
537
* Find openmpi directory
538
539
<pre>
540
$ locate libmpi.so
541
</pre>
542
543 13 Amber Herold
<pre>
544 2 Amber Herold
/usr/lib/openmpi/1.2.7-gcc/lib/libmpi.so
545
</pre>
546
547
* Setup Xmipp to use openmpi by changing three lines in SConstruct
548
549
<pre>
550
$ cp SConstruct SConstruct.orig
551
</pre>
552
553
<pre>
554
$ nano SConstruct
555
</pre>
556
557
<pre>
558
opts.Add('MPI_INCLUDE', 'MPI headers dir ', '/usr/lib/openmpi/1.2.7-gcc/include/')
559 13 Amber Herold
opts.Add('MPI_LIBDIR', 'MPI libraries dir ', '/usr/lib/openmpi/1.2.7-gcc/lib/')
560 2 Amber Herold
opts.Add('MPI_LIB', 'MPI library', 'mpi')
561
</pre>
562
563
* Compile
564
565
<pre>
566
$ sudo mpi-selector --yes --system --set `rpm --qf '%{NAME}-%{VERSION}-gcc-%{ARCH}\n' -q openmpi`
567
</pre>
568
569
<pre>
570
$ export PATH=$PATH:/usr/lib/openmpi/1.2.7-gcc/bin
571
</pre>
572
573
<pre>
574
$ ./scons.configure
575
</pre>
576
577
you should see the line:
578
579
<pre>
580
* Checking for MPI ... yes
581
</pre>
582
583 13 Amber Herold
<pre>
584 2 Amber Herold
$ ./scons.compile
585
</pre>
586
587 13 Amber Herold
h2. 9 Install a PBS job submission system
588 2 Amber Herold
589
You'll need to install a "Portable Batch System":http://en.wikipedia.org/wiki/Portable_Batch_System for job submission, such as "TORQUE":http://en.wikipedia.org/wiki/TORQUE_Resource_Manager . I know Torque comes with Fedora 10, but not CentOS.
590
591
* An RPM is available in the EPEL testing section
592
593
<pre>
594
$ sudo yum -y --enablerepo=epel-testing install torque
595
</pre>
596
597
or another way to get packages
598
599
<pre>
600
$ wget http://centos.karan.org/el5/extras/testing/`uname -i`/RPMS/torque-2.1.9-1.el5.kb.`uname -i`.rpm
601
$ sudo yum -y localinstall --nogpgcheck torque-2.1.9-1.el5.kb.`uname -i`.rpm
602 1 Amber Herold
$ #sudo rpm -Uhv torque-2.1.9-1.el5.kb.`uname -i`.rpm
603
</pre>
604
605
After installing torque it needs to be configured. Sorry, we have no documentation for configuring torque at this time. You may try http://www.clusterresources.com/products/torque-resource-manager.php