Project

General

Profile

Web Server Installation » History » Version 4

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