Project

General

Profile

Actions

Web Server Installation » History » Revision 5

« Previous | Revision 5/40 (diff) | Next »
Amber Herold, 03/16/2010 03:02 PM


Web Server Installation

Web server set up and 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).

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

mrctools are installed as php extension and are 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 instruction 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, mrctools installation will fail.
mrctools Installation

mrctools are installed from php devel directory. This is usually /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 (Look for "extension_dir" in http://your_host/info.php

1. Download dbem tools from http://emg.nysbc.org/software/mrctools.
2. Follow the instruction at http://emg.nysbc.org/software/mrctools/mrc_so.php for installation and testing. The next session 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 at 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 Viewing Tools (myamiweb) Linux Installation

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

1. Download dbem tools from http://emg.nysbc.org/software/dbemtools.
2. Unpack the package in your [webdirectory]

      >cd [webdirectory]            #/var/www/html in this example
      [webdirectory>tar zxvf dbem_1_5_1.tgz

3. 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/dbem_1_5_1/ on CentOS and /srv/www/htdocs/dbem_1_5_1/ on SuSE.
      <?
      // ---define dbem web tools base ---//
      define('BASE_URL',"/dbem_1_5_1/";
      // --- Leginon Viewer Configuration --- //

      // --- Set your leginon MySQL database server parameters

      $DB_HOST    = "[your database host]";
      $DB_USER    = "usr_object";
      $DB_PASS    = "";
      $DB        = "dbemdata";

      // --- XML test dataset
      $XML_DATA = "test/viewerdata.xml";

      // --- Project database config

      $PROJECT_URL = "/project_1_2";
      $PROJECT_DB_HOST = "[your database host]";
      $PROJECT_DB_USER = "usr_object";
      $PROJECT_DB_PASS = "";
      $PROJECT_DB = "projectdata";

4. Test the set-up by visiting http://yourhost/dbem_1_5_1

Project management tools Linux Installation

Leginon sessions can be catagorized into different projects. The projects are created and viewed trhough a set of web tools. To access them, install the tools on the web server. The same project management tools are also used to create and track appion processing databases. If you want to use our processing pipeline, Appion, in the future, you must install this.
Prerequisites for project tools

installed dbemtools and its prerequisites
project tools

Current release: project 1.2.

1. Download project tools from http://emg.nysbc.org/software/dbemtools.
2. Unpack the package in your [webdirectory]

      >cd [webdirectory]            #/var/www/html in this example
      [webdirectory]>tar zxvf project_1_2.tgz

3. Go to the uncompressed directory project_1_2.
      > cd project_1_2

4. Copy config.php.template to config.php
      > cp config.php.template to config.php

5. Edit config.php: You need to insert these MySQL parameters in project tool's config.php
      // --- Project Configuration --- //
      // --- Leginon database config

      $DBEM_PATH="../dbem_1_5_1/";

      $DB_HOST  = "[your database host]";
      $DB_USER  = "usr_object";
      $DB_PASS  = "";
      $DB   = "dbemdata";

      // --- Project database config
      $PROJECT_DB_HOST = "[your database host]";
      $PROJECT_DB_USER = "usr_object";
      $PROJECT_DB_PASS = "";
      $PROJECT_DB = "projectdata";

6. Test the set-up by visiting http://yourhost/project_1_2

Other Tools

This section includes tools that may help with Leginon development.
phpMyAdmin

1. Download phpMyAdmin from Yast2 or www.phpmyadmin.net

  • Download phpMyAdmin into the directory where the web server has been installed.

2. Check phpMyAdmin installation:

      >rpm -qa |grep -i phpmyadmin 

3. Install from tarball:
      > cd [webdirectory]
      [webdirectory]>tar zxvf phpMyAdmin-2.x.tar.gz

      or Install with yum if availabe:

      > yum install phpMyAdmin

4. Create phpMyAdmin configuration file called config.inc.php from a sample.
      [webdirectory]>cd phpMyAdmin
      (if you install with yum, the program directory is /usr/share/phpMyAdmin)

      > cp config.sample.inc.php config.inc.php

5. Make sure these are set correctly in config.inc.php. Note that these are for MySQL which we set earlier. You can set specific user, but it is safer just leave it blank.
      $cfg['Servers'][$i]['host']            = '[your host]';
      $cfg['Servers'][$i]['port']            = '';
      $cfg['Servers'][$i]['socket']          = '';
      $cfg['Servers'][$i]['connect_type']    = 'tcp';
      $cfg['Servers'][$i]['extension']       = 'mysql';
      $cfg['Servers'][$i]['compress']        = FALSE;
      $cfg['Servers'][$i]['controluser']     = '';
      $cfg['Servers'][$i]['auth_type']     = 'http';
      $cfg['Servers'][$i]['user']          = '';
      $cfg['Servers'][$i]['password']      = '';

6. For additional security, you may restrict mysql root access
      $cfg['Servers'][$i]['AllowRoot']     = FALSE;

7. If you want to access phpMyAdmin from another computer, you can add it to its web access configuration file found as /etc/httpd/conf.d/phpMyAdmin.conf in a typical installation
      <Directory /usr/share/phpMyAdmin/>
         order deny,allow
         deny from all
         allow from 127.0.0.1
         allow from YOUR_IP_ADDRESS
      </Directory>

Updated by Amber Herold over 14 years ago · 5 revisions