Project

General

Profile

Web Server Installation » History » Version 25

Amber Herold, 04/06/2010 02:46 PM

1 1 Amber Herold
h1. Web Server Installation
2
3
4 6 Amber Herold
5 1 Amber Herold
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).
6
7 9 Amber Herold
h2. Differences between Linux flavors
8
9 1 Amber Herold
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:
10
11 25 Amber Herold
Table Different File locations and Commands on CentOS vs SUSE
12 1 Amber Herold
13 9 Amber Herold
|_.File or Command Head|_.CentOS|_.SuSE|
14
| php.ini|/etc/| /etc/php5/apache2/|
15
| httpd.conf|/etc/httpd/conf/|/etc/php5/apache2/|
16
| default document_root|/var/www/html/|/srv/www/htdocs/|
17
| apache start/stop/restart command head|/etc/init.d/httpd|/etc/init.d/apache2|
18
| mysql start/stop/restart command head|/etc/init.d/mysqld|/etc/init.d/mysql|
19
20 15 Amber Herold
h2. Web Server Prerequisites
21 9 Amber Herold
22 15 Amber Herold
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.
23 1 Amber Herold
24
25 15 Amber Herold
h3. Install PHP, PHP-devel, gd, and fftw3
26
27
28 16 Amber Herold
* Use the installation tools available for your linux distribution.
29
30 15 Amber Herold
For example, to install gd as php extension you may use
31
32
<pre>
33
CentOS> yum install php-gd
34
SuSE10.2 and above> zypper install php-gd
35 1 Amber Herold
</pre>
36
37 16 Amber Herold
Likewise, use the SuSE Linux YaST2 utility or zypper (openSuSE 10.2 and above) to install.
38
"A list of required CENTOS rpms and instruction":http://emg.nysbc.org/bb/viewtopic.php?t=238 can be found at dbemtools bulletin board at leginon.org.
39 15 Amber Herold
40 17 Amber Herold
* Use the following table to find and install the prerequisite packages required for your distribution of linux:
41 15 Amber Herold
42 17 Amber Herold
*Prerequisite packages for myamiweb*
43 15 Amber Herold
44 1 Amber Herold
|_.Name:|_.Download site:|_.yum package name|_.SuSE rpm name|
45 11 Amber Herold
| Apache| "www.apache.org":http://www.apache.org| httpd| apache2|
46 1 Amber Herold
| php| "www.php.net":http://www.php.net| php| php|
47
| php-devel*| "rpmfind.net/linux/RPM/Development_Languages_PHP.html":http://rpmfind.net/linux/RPM/Development_Languages_PHP.html| php-devel| php-devel|
48
| php-gd (including GD library, its development libraries and header *)| "www.php.ned/gd":http://www.libgd.org  (Use gd2)| php-gd, gd-devel| php-gd,gd-devel|
49 11 Amber Herold
| fftw3 library (including development libraries and header *)| "www.fftw.org":http://www.fftw.org  (Use fftw3.x)| fftw3-devel| fftw3-devel|
50 1 Amber Herold
51 20 Amber Herold
*Note:*
52 19 Amber Herold
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":http://www.php.net/manual/en/image.requirements.php. 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.
53 11 Amber Herold
54 1 Amber Herold
55 6 Amber Herold
h2. Configure php.ini
56 1 Amber Herold
57 22 Amber Herold
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:
58 1 Amber Herold
59
<pre>
60 22 Amber Herold
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING
61
62 1 Amber Herold
register_argc_argv = On
63
64
short_open_tag = On
65
66
max_execution_time = 300     ; Maximum execution time of each script, in seconds
67
max_input_time = 300     ; Maximum amount of time each script may spend parsing request data
68
memory_limit = 256M      ; Maximum amount of memory a script may consume (8MB)
69 11 Amber Herold
</pre>
70 1 Amber Herold
71
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.
72
73 11 Amber Herold
h2. Apache Web Server
74
75 1 Amber Herold
1. Install the Apache Web Server with the YaST or yum utility.
76
77
2. Find "httpd.conf".
78 11 Amber Herold
 This is /etc/httpd/conf/httpd.conf on CentOS and /etc/php5/apache2/httpd.conf on SuSE
79 1 Amber Herold
80 23 Amber Herold
3. Edit the "httpd.conf" configuration file with the following:
81 11 Amber Herold
 <pre>
82 1 Amber Herold
 DirectoryIndex index.htm index.shtm index.html index.shtml index.php
83 23 Amber Herold
84
 HostnameLookups On
85 1 Amber Herold
 </pre>
86 7 Amber Herold
87 23 Amber Herold
*Note:* It may be possible to edit httpd.conf in YaST2 as well.
88 4 Amber Herold
89 3 Amber Herold
4. Restart the web server.
90 1 Amber Herold
91
<pre>
92 24 Amber Herold
apachectl restart
93
     or
94
/etc/init.d/httpd restart     (ON CentOS)
95
     or
96
/etc/init.d/apache2 restart   (ON SuSE)
97
     or
98
/sbin/service httpd restart
99 11 Amber Herold
</pre>                  
100 1 Amber Herold
101
      If you want to start the web server automatically at boot on SuSE
102
103 11 Amber Herold
<pre>
104 24 Amber Herold
SuSE >chkconfig apache2 on
105 11 Amber Herold
</pre>
106 1 Amber Herold
107 11 Amber Herold
h2. Check php information
108 1 Amber Herold
109
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).
110
111
<pre>
112
<?php
113 7 Amber Herold
phpinfo();
114 1 Amber Herold
?>
115
</pre>
116
117
Visit this page at http://yourhost/info.php
118
119
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.
120
121
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.
122 6 Amber Herold
123 11 Amber Herold
!http://emg.nysbc.org/software/leginon/images/images/phpini.png!
124
125
126 1 Amber Herold
h2. mrctools Installation
127 7 Amber Herold
128 21 Amber Herold
Follow [[MRC_PHP_Extension_Installation_and_Testing|these instructions]] to install mrctools which will allow viewing of mrc files in a web browser.
129 13 Amber Herold
130 6 Amber Herold
h2. Web Interface (myamiweb) Linux Installation
131 1 Amber Herold
132 25 Amber Herold
Install php and java scripts for viewing images and Leginon information through the web server.
133
If you are installing your web server on a different machine than your processing server, 
134
you need to download the myami code.
135
*TODO:* add a link to the myami code 
136 1 Amber Herold
137
138 7 Amber Herold
1. Move the myami/myamiweb directory to your Apache web directory
139 6 Amber Herold
140 3 Amber Herold
Example:
141 1 Amber Herold
<pre>
142 6 Amber Herold
> cd [webdirectory]   // /var/www/html in this example
143
> cp [path_to_myami_download_location]/myami/myamiweb .
144 7 Amber Herold
</pre>
145 3 Amber Herold
146 6 Amber Herold
2. Copy config.php.template to config.php and edit the latter by adding these MySQL parameters:
147 7 Amber Herold
"config.php" should be located in /var/www/html/myamiweb/ on CentOS and /srv/www/htdocs/myamiweb/ on SuSE.
148 1 Amber Herold
149 6 Amber Herold
<pre>
150
<?php
151 1 Amber Herold
// --- define myamiweb tools base --- //
152 6 Amber Herold
153
// This should be changed if the myamiweb directory is located 
154
// in a sub-directory of the Apache web directory.
155
// ex. myamiweb is in /var/www/html/applications/myamiweb/ then
156
// change to  define('BASE_PATH',"applications/myamiweb");
157 3 Amber Herold
define('BASE_PATH',"myamiweb"); 
158 6 Amber Herold
159
// Administrator email address
160 3 Amber Herold
define('ADMIN_EMAIL', "example@scripps.edu");
161 6 Amber Herold
162
// --- Set your MySQL database server parameters
163
define('DB_HOST', "localhost");		// DB Host name 
164
define('DB_USER', "usr_object");	// DB User name
165
define('DB_PASS', "");		        // DB Password
166
define('DB_LEGINON', "leginondb");	// Leginon database name
167 1 Amber Herold
define('DB_PROJECT', "projectdb");	// Project database name
168
</pre>
169 8 Amber Herold
170
* Enable the processing plug-in by uncommenting out the following line in the file`myamiweb/config.php`
171
172
<pre>
173
addplugin("processing");
174
</pre>
175
176
* Copy `myamiweb/processing/config_processing.php.template` to `myamiweb/processing/config_processing.php`
177
* Edit `myamiweb/processing/config_processing.php`
178
179
<pre>
180
$PROCESSING_DB_HOST = "your_db_host";
181
$PROCESSING_DB_USER = "usr_object";
182
$PROCESSING_DB_PASS = ""; 
183
$PROCESSING_DB = "";
184
</pre>
185
186
Remember that the last line should be kept empty as this will be set dynamically.
187
We will not include the processing host or cluster registration now. It is covered in the last part of this document.
188 6 Amber Herold
189 1 Amber Herold
3. Test the set-up by visiting http://yourhost/myamiweb