Project

General

Profile

Web Server Installation » History » Version 1

Amber Herold, 03/16/2010 02:22 PM

1 1 Amber Herold
h1. Web Server Installation
2
3
Web server set up and Installation
4
5
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
Differences between Linux flavors
7
8
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:
9
10
Table 4.4. Different File locations and Commands on CentOS vs SUSE
11
File or Command Head	CentOS	SuSE
12
php.ini	/etc/	/etc/php5/apache2/
13
httpd.conf	/etc/httpd/conf/	/etc/php5/apache2/
14
default document_root	/var/www/html/	/srv/www/htdocs/
15
apache start/stop/restart command head	/etc/init.d/httpd	/etc/init.d/apache2
16
mysql start/stop/restart command head	/etc/init.d/mysqld	/etc/init.d/mysql
17
Prerequisites for dbemtools, projecttools, and mrctools extension
18
19
The dbemtools are mostly php scripts that run at the web server. The followings are required before installation of dbemtools and the mrc extension that handles mrc files to be displayed. 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.
20
21
Table�4.5.�Prerequisit packages for dbemtools
22
Name:	Download site:	yum package name	SuSE rpm name
23
Apache	www.apache.org	httpd	apache2
24
php	www.php.net	php	php
25
php-devel*	rpmfind.net/linux/RPM/Development_Languages_PHP.html	php-devel	php-devel
26
php-gd (including GD library, its development libraries and header *)	www.php.ned/gd (Use gd2)	php-gd, gd-devel	php-gd,gd-devel
27
fftw3 library (including development libraries and header *)	www.fftw.org (Use fftw3.x)	fftw3-devel	fftw3-devel
28
29
* 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.
30
Installation tools
31
32
Use the installation tools available for your linux distribution.
33
34
    *
35
36
      For example, Use yum utility to install.
37
    *
38
39
      For example, Use the SuSE Linux YaST2 utility or zypper (openSuSE 10.2 and above) to install.
40
    *
41
42
      A list of required CENTOS rpms and instruction can be found at dbemtools bulletin board at leginon.org.
43
44
PHP, PHP-devel, gd, and fftw3
45
46
Install the packages using your installation tools if available. For example, to install gd as php extension you may use
47
48
CentOS> yum install php-gd
49
SuSE10.2 and above> zypper install php-gd
50
51
Configure php.ini
52
53
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:
54
55
register_argc_argv = On
56
57
short_open_tag = On
58
59
max_execution_time = 300     ; Maximum execution time of each script, in seconds
60
max_input_time = 300     ; Maximum amount of time each script may spend parsing request data
61
memory_limit = 256M      ; Maximum amount of memory a script may consume (8MB)
62
63
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.
64
Apache Web Server
65
66
   1.
67
68
      Install the Apache Web Server with the YaST or yum utility.
69
   2.
70
71
      Find "httpd.conf".
72
73
      This is /etc/httpd/conf/httpd.conf on CentOS and /etc/php5/apache2/httpd.conf on SuSE
74
   3.
75
76
      Edit the "httpd.conf" configuration file to look like the following:
77
78
      <IfModule mod_dir.c>
79
          DirectoryIndex index.htm index.shtm index.html index.shtml index.php
80
      </IfModule>
81
82
      (Note: It may be possible to edit httpd.conf in YaST2 as well.)
83
   4.
84
85
      Restart the web server.
86
87
      apachectl restart
88
           or
89
      /etc/init.d/httpd restart     (ON CentOS)
90
           or
91
      /etc/init.d/apache2 restart   (ON SuSE)
92
93
      If you want to start the web server automatically at boot on SuSE
94
95
       SuSE >chkconfig apache2 on
96
                  
97
98
Check php information
99
100
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).
101
102
<?php
103
phpinfo();
104
?>
105
106
Visit this page at http://yourhost/info.php
107
108
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.
109
110
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.
111
112
mrctools Installation
113
114
mrctools are installed as php extension and are required for displaying mrc files live on the web browser.
115
Install php-devel packages on the web server if missing:
116
117
You can check whether php-devel is installed by typing
118
119
 >phpize
120
121
Follow the instruction for your specific Linux distribution.
122
123
For example, SUSE users can use YaST or zypper to install them
124
php-GD/FFTW3-devel
125
126
Follow instructions from the download site. These may be included already. If not, mrctools installation will fail.
127
mrctools Installation
128
129
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
130
131
   1.
132
133
      Download dbem tools from http://emg.nysbc.org/software/mrctools.
134
   2.
135
136
      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
137
138
Check php information
139
140
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):
141
142
If mrc is not listed, the extension did not get added at the right order.
143
Alternative approach if mrc module does not show up in info.php output
144
145
   1.
146
147
      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/*).
148
   2.
149
150
      Go to the directory and make a copy of any ini file to use as a template for mrc.ini
151
152
      >cd [additional_ini_directory]
153
      >cp gd.ini mrc.ini
154
155
   3.
156
157
      Edit mrc.ini to the following
158
159
      ; comment out next line to disable mrc extension in php
160
      extension=mrc.so
161
162
   4.
163
164
      Comment out mrc extension from php.ini (found in /etc/php.ini/ on a typical PHP installation)
165
166
      ;extension=mrc.so
167
168
   5.
169
170
      restart your webserver
171
172
      > /etc/init.d/httpd restart
173
174
Web Viewing Tools (dbemtools) Linux Installation
175
176
php and java scripts for viewing images and Leginon information through the web server.
177
178
   1.
179
180
      Download dbem tools from http://emg.nysbc.org/software/dbemtools.
181
   2.
182
183
      Unpack the package in your [webdirectory]
184
185
      >cd [webdirectory]			#/var/www/html in this example
186
      [webdirectory>tar zxvf dbem_1_5_1.tgz
187
188
   3.
189
190
      Copy config.php.template to config.php and edit the latter by adding these MySQL parameters:
191
192
      "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.
193
194
      <?
195
      // ---define dbem web tools base ---//
196
      define('BASE_URL',"/dbem_1_5_1/";
197
      // --- Leginon Viewer Configuration --- //
198
199
      // --- Set your leginon MySQL database server parameters
200
201
      $DB_HOST    = "[your database host]";
202
      $DB_USER    = "usr_object";
203
      $DB_PASS    = "";
204
      $DB        = "dbemdata";
205
206
      // --- XML test dataset
207
      $XML_DATA = "test/viewerdata.xml";
208
209
      // --- Project database config
210
211
      $PROJECT_URL = "/project_1_2";
212
      $PROJECT_DB_HOST = "[your database host]";
213
      $PROJECT_DB_USER = "usr_object";
214
      $PROJECT_DB_PASS = "";
215
      $PROJECT_DB = "projectdata";
216
217
   4.
218
219
      Test the set-up by visiting http://yourhost/dbem_1_5_1
220
221
Project management tools Linux Installation
222
223
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.
224
Prerequisites for project tools
225
226
installed dbemtools and its prerequisites
227
project tools
228
229
Current release: project 1.2.
230
231
   1.
232
233
      Download project tools from http://emg.nysbc.org/software/dbemtools.
234
   2.
235
236
      Unpack the package in your [webdirectory]
237
238
      >cd [webdirectory]			#/var/www/html in this example
239
      [webdirectory]>tar zxvf project_1_2.tgz
240
241
   3.
242
243
      Go to the uncompressed directory project_1_2.
244
245
      > cd project_1_2
246
247
   4.
248
249
      Copy config.php.template to config.php
250
251
      > cp config.php.template to config.php
252
253
   5.
254
255
      Edit config.php: You need to insert these MySQL parameters in project tool's config.php
256
257
      // --- Project Configuration --- //
258
259
      // --- Leginon database config
260
      $DBEM_PATH="../dbem_1_5_1/";
261
262
      $DB_HOST  = "[your database host]";
263
      $DB_USER  = "usr_object";
264
      $DB_PASS  = "";
265
      $DB   = "dbemdata";
266
267
      // --- Project database config
268
      $PROJECT_DB_HOST = "[your database host]";
269
      $PROJECT_DB_USER = "usr_object";
270
      $PROJECT_DB_PASS = "";
271
      $PROJECT_DB = "projectdata";
272
273
   6.
274
275
      Test the set-up by visiting http://yourhost/project_1_2
276
277
Other Tools
278
279
This section includes tools that may help with Leginon development.
280
phpMyAdmin
281
282
   1.
283
284
      Download phpMyAdmin from Yast2 or www.phpmyadmin.net
285
286
          *
287
288
            Download phpMyAdmin into the directory where the web server has been installed.
289
290
   2.
291
292
      Check phpMyAdmin installation:
293
294
      >rpm -qa |grep -i phpmyadmin 
295
296
   3.
297
298
      Install from tarball:
299
300
      > cd [webdirectory]
301
      [webdirectory]>tar zxvf phpMyAdmin-2.x.tar.gz
302
303
      or Install with yum if availabe:
304
305
      > yum install phpMyAdmin
306
307
   4.
308
309
      Create phpMyAdmin configuration file called config.inc.php from a sample.
310
311
      [webdirectory]>cd phpMyAdmin
312
      (if you install with yum, the program directory is /usr/share/phpMyAdmin)
313
314
      > cp config.sample.inc.php config.inc.php
315
316
   5.
317
318
      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.
319
320
      $cfg['Servers'][$i]['host']            = '[your host]';
321
      $cfg['Servers'][$i]['port']            = '';
322
      $cfg['Servers'][$i]['socket']          = '';
323
      $cfg['Servers'][$i]['connect_type']    = 'tcp';
324
      $cfg['Servers'][$i]['extension']       = 'mysql';
325
      $cfg['Servers'][$i]['compress']        = FALSE;
326
      $cfg['Servers'][$i]['controluser']     = '';
327
      $cfg['Servers'][$i]['auth_type']     = 'http';
328
      $cfg['Servers'][$i]['user']          = '';
329
      $cfg['Servers'][$i]['password']      = '';
330
331
   6.
332
333
      For additional security, you may restrict mysql root access
334
335
      $cfg['Servers'][$i]['AllowRoot']     = FALSE;
336
337
   7.
338
339
      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
340
341
      <Directory /usr/share/phpMyAdmin/>
342
         order deny,allow
343
         deny from all
344
         allow from 127.0.0.1
345
         allow from YOUR_IP_ADDRESS
346
      </Directory>