Project

General

Profile

Actions

Web Server Installation » History » Revision 13

« Previous | Revision 13/40 (diff) | Next »
Amber Herold, 04/02/2010 03:00 PM


Web Server Installation

The following applies to the computer that will host the web-accessable image viewers ( a part of dbem tools) and project manager (a part of project tools).

Differences between Linux flavors

Different Linux flavors often put web server and mysql-related files in different locations. This can be confusing. From experience, we found the equivalent on CentOS vs SuSE. Here we list them for reference. If your system use a different naming and you are willing to share your experience, please send us the list. We will add it here:

Table 4.4. Different File locations and Commands on CentOS vs SUSE

File or Command Head CentOS SuSE
php.ini /etc/ /etc/php5/apache2/
httpd.conf /etc/httpd/conf/ /etc/php5/apache2/
default document_root /var/www/html/ /srv/www/htdocs/
apache start/stop/restart command head /etc/init.d/httpd /etc/init.d/apache2
mysql start/stop/restart command head /etc/init.d/mysqld /etc/init.d/mysql

Prerequisites for dbemtools, projecttools, and mrctools extension

The myamiweb files are mostly php scripts that run at the web server. The following packages are required before installation of myamiweb and the mrc extension that handles the display of mrc files. Some of these packages may be found on the SuSE Linux DVD or included in common package repository. MySQL and the Apache Web Server can be downloaded from their respective websites.

Table 4.5.Prerequisite packages for myamiweb

Name: Download site: yum package name SuSE rpm name
Apache www.apache.org httpd apache2
php www.php.net php php
php-devel* rpmfind.net/linux/RPM/Development_Languages_PHP.html php-devel php-devel
php-gd (including GD library, its development libraries and header *) www.php.ned/gd (Use gd2) php-gd, gd-devel php-gd,gd-devel
fftw3 library (including development libraries and header *) www.fftw.org (Use fftw3.x) fftw3-devel fftw3-devel
  • mrctools are compiled and added to php extension with php-devel package. Mrctools use GD and FFTW3 that need to be compiled from their development libraries while the extension is compiled. If GD and FFTW3 sources were downloaded and compiled directly on your computer, these development files are included. If (as in most cases) GD and FFTW3 are installed from rpm, they are not included. An error message will appear when you attempt to compile mrctools. In this case, you will need separate download and installation of GD-devel and FFTW3-devel. Search http://rpmfind.net/linux/rpm2html/ for GD-devel and FFTW3-devel for the rpm distribution needed for your system.

Installation tools

Use the installation tools available for your linux distribution.

  • For example, Use yum utility to install.
  • For example, Use the SuSE Linux YaST2 utility or zypper (openSuSE 10.2 and above) to install.
  • A list of required CENTOS rpms and instruction can be found at dbemtools bulletin board at leginon.org.

PHP, PHP-devel, gd, and fftw3

Install the packages using your installation tools if available. For example, to install gd as php extension you may use

CentOS> yum install php-gd
SuSE10.2 and above> zypper install php-gd

Configure php.ini

Edit the following two sections in php.ini (found as /etc/php.ini on CentOS and /etc/php5/apache2/php.ini on SuSE) so that they look like the following:

register_argc_argv = On

short_open_tag = On

max_execution_time = 300     ; Maximum execution time of each script, in seconds
max_input_time = 300     ; Maximum amount of time each script may spend parsing request data
memory_limit = 256M      ; Maximum amount of memory a script may consume (8MB)

You may want to increase max_input_time and memory_limit if the server is heavily used. At NRAMM, max_input_time=600 and memory_limit=4000M.

Apache Web Server

1. Install the Apache Web Server with the YaST or yum utility.

2. Find "httpd.conf".
This is /etc/httpd/conf/httpd.conf on CentOS and /etc/php5/apache2/httpd.conf on SuSE

3. Edit the "httpd.conf" configuration file to look like the following:

 DirectoryIndex index.htm index.shtm index.html index.shtml index.php
 

Note: It may be possible to edit httpd.conf in YaST2 as well.

4. Restart the web server.

      apachectl restart
           or
      /etc/init.d/httpd restart     (ON CentOS)
           or
      /etc/init.d/apache2 restart   (ON SuSE)
If you want to start the web server automatically at boot on SuSE
       SuSE >chkconfig apache2 on

Check php information

Create the following info.php in your web server document root directory (/var/www/html on CentOS. /srv/www/htdocs on SuSE. You can find its location in httpd.conf mentioned above under the line starting DocumentRoot).

<?php
phpinfo();
?>

Visit this page at http://yourhost/info.php

You will see comprehensive tables of php and apache information, including the location of the addition .ini files, extension, include path, and what extension is enabled.

Here is an example screen shot of the part of the info.php page that tells you where php.ini and other configuration files are.

mrctools Installation

Follow these instructions to install mrctools which will allow viewing of mrc files in a web browser.

mrctools is installed as a php extension and is required for displaying mrc files live on the web browser.

Install php-devel packages on the web server if missing:

You can check whether php-devel is installed by typing

 >phpize

Follow the instructions for your specific Linux distribution.
For example, SUSE users can use YaST or zypper to install them.

php-GD/FFTW3-devel

Follow instructions from the download site. These may be included already. If not, the mrctools installation will fail.

mrctools Installation

mrctools is installed from the php devel directory. This is usually located in /usr/include/php/ext where you will find other php extension source such as gd. After the installation, mrc.so should be placed in php's extension directory. The location of the extension directory can be found by looking for "extension_dir" in http://your_host/info.php.

1. Download mrctools tools from http://emg.nysbc.org/software/mrctools.
2. Follow the instructions at http://emg.nysbc.org/software/mrctools/mrc_so.php for installation and testing. The next section about checking php information can also help debugging the installation

Check php information

Visit or refresh http://yourhost/info.php which you created earlier. It should have a section looking like this (The version should correspond to what you've just installed):

If mrc is not listed, the extension did not get added in the right order.

Alternative approach if mrc module does not show up in info.php output

1. find in the info.php web page the location of "additional .ini files parsed" in the first table (such as /etc/php.d/conf.d/*).

2. Go to the directory and make a copy of any ini file to use as a template for mrc.ini

      >cd [additional_ini_directory]
      >cp gd.ini mrc.ini

3. Edit mrc.ini to the following

      ; comment out next line to disable mrc extension in php
      extension=mrc.so

4. Comment out mrc extension from php.ini (found in /etc/php.ini/ on a typical PHP installation)

      ;extension=mrc.so

5. restart your webserver

      > /etc/init.d/httpd restart

Web Interface (myamiweb) Linux Installation

php and java scripts for viewing images and Leginon information through the web server.

1. Move the myami/myamiweb directory to your Apache web directory

Example:

> cd [webdirectory]   // /var/www/html in this example
> cp [path_to_myami_download_location]/myami/myamiweb .

2. Copy config.php.template to config.php and edit the latter by adding these MySQL parameters:
"config.php" should be located in /var/www/html/myamiweb/ on CentOS and /srv/www/htdocs/myamiweb/ on SuSE.

<?php
// --- define myamiweb tools base --- //

// This should be changed if the myamiweb directory is located 
// in a sub-directory of the Apache web directory.
// ex. myamiweb is in /var/www/html/applications/myamiweb/ then
// change to  define('BASE_PATH',"applications/myamiweb");
define('BASE_PATH',"myamiweb"); 

// Administrator email address
define('ADMIN_EMAIL', "example@scripps.edu");

// --- Set your MySQL database server parameters
define('DB_HOST', "localhost");        // DB Host name 
define('DB_USER', "usr_object");    // DB User name
define('DB_PASS', "");                // DB Password
define('DB_LEGINON', "leginondb");    // Leginon database name
define('DB_PROJECT', "projectdb");    // Project database name
  • Enable the processing plug-in by uncommenting out the following line in the file`myamiweb/config.php`
addplugin("processing");
  • Copy `myamiweb/processing/config_processing.php.template` to `myamiweb/processing/config_processing.php`
  • Edit `myamiweb/processing/config_processing.php`
$PROCESSING_DB_HOST = "your_db_host";
$PROCESSING_DB_USER = "usr_object";
$PROCESSING_DB_PASS = ""; 
$PROCESSING_DB = "";

Remember that the last line should be kept empty as this will be set dynamically.
We will not include the processing host or cluster registration now. It is covered in the last part of this document.

3. Test the set-up by visiting http://yourhost/myamiweb

Updated by Amber Herold over 14 years ago · 13 revisions