Web Server Installation » History » Revision 7
« Previous |
Revision 7/40
(diff)
| Next »
Amber Herold, 03/16/2010 04:22 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¶
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 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
3. Test the set-up by visiting http://yourhost/myamiweb
Updated by Amber Herold over 14 years ago · 7 revisions