Project

General

Profile

Start with existing CentOS installation » History » Revision 45

Revision 44 (Amber Herold, 03/15/2010 03:54 PM) → Revision 45/80 (Amber Herold, 03/15/2010 03:58 PM)

h1. Start with existing CentOS 5.3 64-bit installation 

 {{>toc}} 

 h2. 3 Download additional software  

 h3. 3.1 Install the additional package repositories  

 *NOTE* 

 There are several additional CentOS repositories that you can install. 
 These repositories provide additional packages, such as patented software (MP3 players), 
 closed source applications (Flash plugin, Adobe Acrobat Reader) 
 and lesser used packages (python numpy, Gnu Scientific Library). 
 But some repositories install packages over other packages, 
 which can cause problems and conflicts (ATrpms is bad at this). So I recommend only installing 
 EPEL and RPM Fusion. Read more here: 
 "CentOS Additional Repositories":http://wiki.centos.org/AdditionalResources/Repositories  

 h4. 3.1.1 Extra Packages for Enterprise Linux (EPEL)  

 * http://fedoraproject.org/wiki/EPEL 
 * contains a wealth of packages required for appion 

 .Download repository rpm and install 

 <pre> 
 $ sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/`uname -i`/epel-release-5-3.noarch.rpm 
 </pre> 

 h4. 3.1.2 RPM Fusion  

 * http://rpmfusion.org/ 
 * good for mp3 and other patent limited software 

 .Download repository rpms and install 

 <pre> 
 $ sudo rpm -Uhv http://download1.rpmfusion.org/free/el/updates/testing/5/`uname -i`/rpmfusion-free-release-5-0.1.noarch.rpm 
 $ sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/el/updates/testing/5/`uname -i`/rpmfusion-nonfree-release-5-0.1.noarch.rpm 
 </pre> 

 h3. 3.2 Update current packages  

 .Update the updater to make life easier 

 <pre> 
 $ sudo yum -y update yum 
 </pre> 

 .Update all packages 

 <pre> 
 $ sudo yum -y update 
 </pre> 

 *NOTE* 
 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  
 You may want to restart your computer when this completes. 

 h4. .Install Complete list of additional packages: 

 * *python tools*: python-tools python-devel 
 * *general applications*: subversion ImageMagick grace gnuplot python-matplotlib 
 * *Tilt Picker*: wxPython numpy scipy python-imaging 
 * *FindEM*: gcc-gfortran compat-gcc-34-g77 
 * *Ace 2*: gcc-objc fftw3-devel gsl-devel 
 * *Sinedon*: mysql mysql-server MySQL-python 
 * *DBEM*: httpd php php-mysql phpMyAdmin 
 * *Xmipp MPI*: gcc-c++ openmpi-devel libtiff-devel 
 * *MRC tools*: php-devel gd-devel re2c fftw2-devel php-gd 
 * *UCSF Chimera imaging*: xorg-x11-server-Xvfb 

 <pre> 
 $ sudo yum -y install \ 
 python-tools python-devel python-matplotlib \ 
 subversion ImageMagick grace gnuplot \ 
 wxPython numpy scipy python-imaging \ 
 gcc-gfortran compat-gcc-34-g77 \ 
 gcc-objc fftw3-devel gsl-devel \ 
 mysql mysql-server MySQL-python \ 
 httpd php php-mysql phpMyAdmin    \ 
 gcc-c++ openmpi-devel libtiff-devel \ 
 php-devel gd-devel re2c fftw2-devel php-gd \ 
 xorg-x11-server-Xvfb 
 </pre> 

 If you have an nVidia video card and setup RPM fusion, install the nVidia binary, will speed things up especially for UCSF Chimera 

 <pre> 
 $ sudo yum -y install nvidia-x11-drv 
 </pre> 

 .Clean up packages to save drive space 

 <pre> 
 $ sudo yum clean all 
 </pre> 

 .Re-index the hard drive, this will come in handy later 

 <pre> 
 $ sudo updatedb 
 </pre> 

 .Enable servers on reboot 

 <pre> 
 $ sudo /sbin/chkconfig httpd on 
 </pre> 

 <pre> 
 $ sudo /sbin/chkconfig mysqld on 
 </pre> 

 You can further configure this with the GUI and turn off unnecessary items 

 <pre> 
 $ system-config-services 
 </pre> 

 .Reboot the computer 

 <pre> 
 $ sudo reboot 
 </pre> 

 ---- 

 h2. 4 MRC PHP Extension Installation and Testing 

 h3. 4.1 Build the MRC module 

 Download "php_mrc_src_1_5_1.tgz":http://emg.nysbc.org/software/dwd.php?id=N1HDb4ac22efb5b38b05fd3575d42d3e4adc2 

 h4. cd to your php devel directory 

 <pre> 
 > cd /usr/include/php/ext/ 
 > mv [downloads]/php_mrc_src_1_5_1.tgz . 
 </pre> 

 h4. Untar the archive 

 <pre> 
 > tar zxvf php_mrc_src_1_5_1.tgz 
 > cd mrc/ 
 </pre> 

 h4. Make sure that GD and FFTW 3 devel libraries are installed 

 <pre> 
 > phpize 
 > ./configure  
 > make 
 > make install 
 </pre> 

 h3. 4.2 Install MRC module 

 h4.    Check that mrc.so is in your php extension directory 

 <pre> 
 > ls /usr/lib/php/extensions 
 </pre> 

 You should see mrc.so listed. 

 h4. Make sure that GD and FFTW 3 libraries are installed 

 * edit your    php configuration file php.ini to add "mrc.so" extension. 
 * You might also increase the memory_limit field. It is set to 8M by default. The more the merrier! 
 * 4kx4k float MRC image is about 64MB 
 <pre> 
 > vi /etc/php.ini 
 </pre> 

 * increase memory 
 <pre> 
 > memory_limit = 256M; Maximum amount of memory 
 </pre> 

 * Create the mrc.ini file 

 <pre> 
 > cd /etc/php.d 
 vi mrc.ini 
 </pre> 

 * add the following lines 

 <pre> 
  ; Enable mrc extension module 
  extension=mrc.so 
 </pre> 

 *NOTE:* If PHP modules are already listed in PHP.ini do the following: 

 * check extension_dir value 
 <pre> 
  extension_dir = /usr/lib64/php/extensions 
 </pre> 

 * add the following at the end of the [extension section] 

 <pre> 
  extension=mrc.so 
 </pre> 

 h4. Restart your webserver 

 <pre> 
 /etc/init.d/apache2 restart 
 </pre> 

 OR 

 <pre> 
 /etc/init.d/httpd restart 
 </pre> 

 h3. 4.3 Test the MRC module installation 

 Download this MRC file "mymrc.mrc":http://emg.nysbc.org/attachments/55/mymrc.mrc and the following 2 scripts into the same directory to test the PHP mrc extension.  
 * gd module testing script "ex1.php":http://emg.nysbc.org/attachments/53/ex1.php 
 * fftw module testing script "ex2.php":http://emg.nysbc.org/attachments/54/ex2.php 

 Run the scripts with the following commands: 
 The expected results are shown below. If you get the same images, you've installed the extension properly. 

 <pre> 
 > php -q ex1.php | display 
 </pre> 

 * gd module test result: 
 !http://emg.nysbc.org/attachments/57/ex1.php.png! 

 <pre> 
 > php -q ex2.php | display 
 </pre> 

 * fftw module test result: 
 !http://emg.nysbc.org/attachments/58/ex2.php.png! 

 ---- 

 h2. 5 Compile and setup Appion python programs  

 Download Myami.   
 *TODO: Place link to file here!* 
 Install leginon http://emg.nysbc.org/documentation/leginon/bk02ch04s06.php 

 h3. Perform system check: 

 In addition to the downloads from our svn depository, there are several other requirements that you will get either from your OS installation source, or from its respective website. The system check in the Leginon package checks your system to see if you already have these requirements 

 cd your_download_area/Leginon-1.6-ALL/Leginon 
 python syscheck.py 

 If python is not installed, this, of course will not run. If you see any lines like "*** Failed...", then you have something missing. Otherwise, everything should result in "OK". 

 h3. Install the package in each folder with commands like these 

 *TODO: move these into a single installer, ask Jim* 

 cd /your_download_area/myami/leginon 
 python setup.py install 

 cd ../pyami 
 python setup.py install 
 cd ../pyScope 
 python setup.py install 
 cd ../sinedon 
 python setup.py install 
 cd ../numextension 
 python setup.py install 
 cd ../libcv 
 python setup.py install 
 cd ../imageviewer 
 python setup.py install 

 h3. python-site-package-path: where the installed python packages went: 

 Python installer put the packages you installed to its site-packages directory. This enable all users on the same computer to access them. The easiest way to find where your installed package is called by python is to load a module from the package using interactive python command lines like this: 

     * Start python command line from shell 

       > python 

     * Import a module from the package. Let's try sinedon here. All packages installed through the above setup.py script should go to the same place. 

       python> import sinedon 

     * If the module is loaded successfully, call the module attribute __path__ (two underscrolls before "path" and two underscrolls after) will return the location of the module it is loaded from 

       python> sinedon.__path__ 

       RETURNS, For example, 
       python> <module 'sinedon' from '/usr/lib/python2.5/site-packages/sinedon/__init__.pyc'>  

       In this case, /usr/lib/python2.5/site-packages/ is your python-site-package-path. If you go to that directory, you will find all the packages you just installed. 

 h3. Configure leginon.cfg: 

 A skeleton (default) configuration file is available: 
 [python-site-package-path]/Leginon/config/default.cfg 

 * Copy default.cfg to leginon.cfg. 
   cp [python-site-package-path]/Leginon/config/default.cfg [python-site-package-path]/Leginon/config/leginon.cfg 

 * Add a directory for images. The rest is optional. 

   Example of the configuration that you should set: (Here we assume your leginon database is named "dbemdata", and Leginon log into the database as a user named "usr_object" with no password set). 

   [Images] 
   path: your_storage_disk_path/leginon 

 h3. Names used in the example installation 

 From this point on, you will need to enter database user names for different configuration files and settings. These are NOT Leginon user names but what is required by MySQL database interaction. Consistent names are essential. In the example shown here, the leginon database is called "dbemdata", the project database is called "projectdata". The MySQL user name are the same, "usr_object", and in this case without a password. 

 h3. Configure sinedon.cfg: 

 *TODO: Consider moving this after we setup Mysql username.* 

 Sinedon is designed to be able to interact with multiple databases. It can be configured at global or user level. 

     * An example configuration file is available at: 
       /your_download_area/Leginon-1.6-ALL/sinedon/examples/sinedon.cfg 

     * Configurations for all users should be placed at the following path: 
       [python-site-package-path]/sinedon/sinedon.cfg 

     * Modify host,db,user,passwd to what is used. Note that the user here is the MySQL user Leginon uses to communicate with the database for all Leginon users. For Leginon that uses Project database, set the following: 

       [global] 
       host: your_database_host 
       user: usr_object 
       passwd: 

       [projectdata] 
       db: projectdata 

       [leginondata] 
       db: dbemdata 

     * Add database configuration if you intend to use grid-inserting robot. The Robot2 module uses the database to communicate to the robot. Applications that carries the name "Robot" requires this to be set. In general, using the same database as the general leginon database is fine. 

       [robot2] 
       db: dbemdata 

 h3. 5.1 Compile FindEM  

 * Goto appion/findem folder to make findem.exe 

 * Compile the libraries and binary 

 <pre> 
 $ make 
 </pre> 

 * Test findem.exe to see if it runs 

 <pre> 
 $ make test 
 </pre> 

 *WARNING* 
 Only if the first part fails, you must add the path to libg2c.so library file. 
 Otherwise skip to next section. 

 * locate libg2c.so library file 

 <pre> 
 $ ls /usr/lib/gcc/`uname -i`-redhat-linux/3.4.6/libg2c.so 
 </pre> 

 <pre> 
 $ locate libg2c.so 
 </pre> 

 * Edit Makefile with location of libg2c.so 

 <pre> 
 $ nano Makefile 
 </pre> 

 * Example: EXLIBS=-L/usr/lib/gcc/i386-redhat-linux/3.4.6/ -lg2c 
 * Re-compile 

 h3. 5.2 Compile Ace2  

 The 64 bit Ace2 binary is already available in the myami/bin directory.  
 Test it by changing directories to myami/bin and type the following commands: 
 <pre> 
 $ ./ace2.exe -h 
 $ ./ace2correct.exe -h 
 </pre> 
 Notice the help display. 

 <pre> 
 If this does not work or you wish to compile it yourself follow the instructions here. 
 NOTE: 
 ace2 typically requires fftw 3.2 or greater. This is significantly faster than 3.1 (which is distributed with CentOS).  
 There is a FFTW_WISDOM_ONLY flag in Image.m that can be commented in if you are using fftw 3.2 or greater. 
 *TODO: Can we have the make file detect which version is installed?* 

 * Goto myami/appion/ace2 
 * compile the libraries and binary 
 * test to see if program runs 

 $ make 
 $ ./ace2.exe -h 
 $ ./ace2correct.exe -h 
 $ mv -v ./ace2*.exe ../bin 
 </pre> 

 h3. 5.3 Compile Radermacher module  

 * Goto appion/radermacher 

 * compile the libraries and binary 

 <pre> 
 $ python ./setup.py build 
 </pre> 

 * install module globally 

 <pre> 
 $ sudo python ./setup.py install 
 </pre> 

 * test installed module 

 <pre> 
 $ python 
 </pre> 

 <pre> 
 >>> import radermacher 
 >>> <Ctrl-D> 
 </pre> 

 h3. 5.4 Test Appion  

 * Go into the appion directory 
 * Add myami to PYTHONPATH if myami is built locally (in home directory) 
 *TODO: what does this mean?* 

 <pre> 
 $ export PYTHONPATH="/your-complete-path-to-myami:$PYTHONPATH" 
 </pre> 

 * Add appion to PYTHONPATH 

 <pre> 
 $ export PYTHONPATH="/your-complete-path-to-myami/appion:$PYTHONPATH" 
 </pre> 

 *TODO: Consider moving appionlib so you only need to set one path.* 

 * Run the test script 

 <pre> 
 $ ./check.sh 
 </pre> 

 *NOTE* 
 You can ignore EMAN, MATLAB, and UCSF Chimera errors at this point 

 ---- 

 h2. 6 Setup MySQL (appiondata) databases  

 [[Setup MySQL database]] 

 Refer to [[Start_with_existing_ANY_Linux_flavor_OS#2-Setup-MySQL-databases|Setup MySQL databases]] 

 h3. Configure MySQL  

 Edit the configuration file: 

 <pre> 
 $ sudo nano /etc/my.cnf 
 </pre> 

 Add or edit the following lines: 

 <pre> 
 query_cache_type = 1 
 query_cache_size = 100M 
 query_cache_limit= 100M 
 </pre> 

 Restart MySQL 

 <pre> 
 $ sudo /sbin/service mysqld restart 
 </pre> 

 h3. Configure phpMyAdmin  

 Edit the phpMyAdmin config file: 

 <pre> 
 $ sudo nano /etc/phpMyAdmin/config.inc.php 
 </pre>  

 and change the following lines: 

 <pre> 
 $cfg['Servers'][$i]['AllowRoot']       = FALSE; 
 </pre> 

 Edit the phpMyAdmin apache config file: 

 <pre> 
 $ sudo nano /etc/httpd/conf.d/phpMyAdmin.conf 
 </pre> 

 and change the following lines: 

 <pre> 
 <Directory /usr/share/phpMyAdmin/> 
    order deny,allow 
    deny from all 
    allow from 127.0.0.1 
    allow from YOUR_IP_ADDRESS 
 </Directory> 
 </pre> 

 ---- 

 h2. 7 Install webpages (appionweb) 

 Refer to [[Start_with_existing_ANY_Linux_flavor_OS#3-Web-server-side-installation|Web server side installation]] 

 h3. Install MRC Tools  

 h4. Compile MRC tools  

 * Go to your php devel directory and untar the archive 
 * If unsure where it is, use info.php to find it under *extension_dir* 

 <pre> 
 $ cd /usr/include/php/ext/ 
 $ sudo mkdir mrc 
 $ sudo chmod 777 mrc 
 $ sudo chown $USER mrc 
 </pre> 

 * Unpackage MRC Tools from http://emg.nysbc.org/software/mrctools/ 

 <pre> 
 $ tar zxvf ~/php_mrc.tgz 
 $ cd mrc/ 
 </pre> 

 * Compile and install the MRC module 

 <pre> 
 $ phpize 
 $ ./configure  
 $ make 
 $ sudo make install 
 </pre> 

 h4. Configure PHP for MRC Tools  

 * Edit your php configuration file php.ini to add "mrc.so" extension. 

 <pre> 
 $ sudo nano /etc/php.d/mrc.ini 
 </pre> 

 * add mrc.so to extensions 

 <pre> 
 ; Enable mrc extension module 
 extension=mrc.so 
 </pre> 

 * To test MRC tools, go to this website: 
 http://emg.nysbc.org/software/mrctools/mrc_so.php 

 h3. Configure PHP  

 * increase the memory limit, EM images are big 64MB: 

 <pre> 
 memory_limit = 256M; Maximum amount of memory 
 </pre> 

 * Turn error display on: 

 <pre> 
 display_errors = On 
 </pre> 

 <pre> 
 error_reporting = E_ALL & ~E_NOTICE 
 </pre> 

 * restart the webserver 

 <pre> 
 $ sudo /sbin/service httpd restart 
 </pre> 

 h3. Install DBEM and project php source  

 Please consult the other [[Start_with_existing_ANY_Linux_flavor_OS#3-Web-server-side-installation|Install guide]] 

 h3. Configuration  

 h4. configure apache  

 * allow REMOTE_HOST lookups in apache 

 <pre> 
 $ sudo nano /etc/httpd/conf/httpd.conf 
 </pre> 

 * turn _HostnameLookups_ to On 

 <pre> 
 HostnameLookups On 
 </pre> 

 * restart the webserver 

 <pre> 
 $ sudo /sbin/service httpd restart 
 </pre> 

 h4. configure project_1_2, dbem_1_5_1, and dbem_1_5_1/processing  

 Please consult the other [[Start_with_existing_ANY_Linux_flavor_OS#3-Web-server-side-installation|Install guide]] 

 h3. Initialize database tables from the web tools  

 Please consult [[Start_with_existing_ANY_Linux_flavor_OS#4-Create-a-test-project-and-processing-database|Create a test project and processing database]] 

 h3. Potential problems  

 h4. Firewall settings  

 You may need to configure your firewall to allow incoming HTTP (port 80) and MySQL (port 3306) traffic: 

 <pre> 
 $ system-config-securitylevel 
 </pre> 

 h4. Security-enhanced linux  

 "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: 

 <pre> 
 $ sudo /usr/bin/chcon -R -t httpd_sys_content_t /var/www/html/ 
 </pre> 

 see "this website":http://docs.fedoraproject.org/selinux-apache-fc3/sn-simple-setup.html    for more details on SELinux 

 ---- 

 h2. 8 Install external packages  

 *Please follow individual package installation instruction provided with them* 

 h3. Compile Xmipp for OpenMPI  

 * For more info, see http://xmipp.cnb.csic.es/twiki/bin/view/Xmipp/InstallingTheSoftware 
 * Go into Xmipp source directory 
 * Find openmpi directory 

 <pre> 
 $ locate libmpi.so 
 </pre> 

 <pre> 
 /usr/lib/openmpi/1.2.7-gcc/lib/libmpi.so 
 </pre> 

 * Setup Xmipp to use openmpi by changing three lines in SConstruct 

 <pre> 
 $ cp SConstruct SConstruct.orig 
 </pre> 

 <pre> 
 $ nano SConstruct 
 </pre> 

 <pre> 
 opts.Add('MPI_INCLUDE', 'MPI headers dir ', '/usr/lib/openmpi/1.2.7-gcc/include/') 
 opts.Add('MPI_LIBDIR', 'MPI libraries dir ', '/usr/lib/openmpi/1.2.7-gcc/lib/') 
 opts.Add('MPI_LIB', 'MPI library', 'mpi') 
 </pre> 

 * Compile 

 <pre> 
 $ sudo mpi-selector --yes --system --set `rpm --qf '%{NAME}-%{VERSION}-gcc-%{ARCH}\n' -q openmpi` 
 </pre> 

 <pre> 
 $ export PATH=$PATH:/usr/lib/openmpi/1.2.7-gcc/bin 
 </pre> 

 <pre> 
 $ ./scons.configure 
 </pre> 

 you should see the line: 

 <pre> 
 * Checking for MPI ... yes 
 </pre> 

 <pre> 
 $ ./scons.compile 
 </pre> 

 h2. 9 Install a PBS job submission system 

 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. 

 * An RPM is available in the EPEL testing section 

 <pre> 
 $ sudo yum -y --enablerepo=epel-testing install torque 
 </pre> 

 or another way to get packages 

 <pre> 
 $ wget http://centos.karan.org/el5/extras/testing/`uname -i`/RPMS/torque-2.1.9-1.el5.kb.`uname -i`.rpm 
 $ sudo yum -y localinstall --nogpgcheck torque-2.1.9-1.el5.kb.`uname -i`.rpm 
 $ #sudo rpm -Uhv torque-2.1.9-1.el5.kb.`uname -i`.rpm 
 </pre> 

 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