Web Server Installation » History » Revision 27
« Previous |
Revision 27/40
(diff)
| Next »
Amber Herold, 04/06/2010 03:02 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 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 |
Web Server Prerequisites¶
The myamiweb files are mostly php scripts that run at the web server. PHP, PHP-devel, gd, and fftw3 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.
Install PHP, PHP-devel, gd, and fftw3¶
- Use the installation tools available for your linux distribution.
For example, to install gd as php extension you may use
CentOS> yum install php-gd SuSE10.2 and above> zypper install php-gd
Likewise, 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.
- Use the following table to find and install the prerequisite packages required for your distribution of linux:
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 |
Note:
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. More information on the gd library can be found here. If you find that you can only view images as png instead of jpg, it may be that you do not have gd jpeg support installed.
Configure php.ini¶
Edit the following items 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:
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING 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 with the following:
DirectoryIndex index.htm index.shtm index.html index.shtml index.php HostnameLookups On
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) or /sbin/service httpd restartIf 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.
MRC PHP Extension Installation¶
Follow these instructions to install mrctools which will allow viewing of mrc files in a web browser.
Web Interface (myamiweb) Linux Installation¶
Install php and java scripts for viewing images and Leginon information through the web server.
If you are installing your web server on a different machine than your processing server,
you need to download the myami code.
TODO: add a link to the myami code
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
Potential problems¶
Firewall settings¶
You may need to configure your firewall to allow incoming HTTP (port 80) and MySQL (port 3306) traffic:
$ system-config-securitylevel
Security-enhanced linux¶
Security-enhanced linux may be preventing your files from loading. To fix this run the following command:
$ sudo /usr/bin/chcon -R -t httpd_sys_content_t /var/www/html/
see this website for more details on SELinux
Updated by Amber Herold over 14 years ago · 27 revisions