Web Server Installation » History » Version 12
Amber Herold, 04/02/2010 02:55 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 | Table 4.4. Different File locations and Commands on CentOS vs SUSE |
||
12 | |||
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 | h2. Prerequisites for dbemtools, projecttools, and mrctools extension |
||
21 | |||
22 | 1 | 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. |
23 | |||
24 | 2 | Amber Herold | Table 4.5.Prerequisite packages for myamiweb |
25 | 1 | Amber Herold | |
26 | 9 | Amber Herold | |_.Name:|_.Download site:|_.yum package name|_.SuSE rpm name| |
27 | | Apache| "www.apache.org":http://www.apache.org| httpd| apache2| |
||
28 | | php| "www.php.net":http://www.php.net| php| php| |
||
29 | | php-devel*| "rpmfind.net/linux/RPM/Development_Languages_PHP.html":http://rpmfind.net/linux/RPM/Development_Languages_PHP.html| php-devel| php-devel| |
||
30 | | 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| |
||
31 | | fftw3 library (including development libraries and header *)| "www.fftw.org":http://www.fftw.org (Use fftw3.x)| fftw3-devel| fftw3-devel| |
||
32 | |||
33 | 1 | 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. |
34 | 9 | Amber Herold | |
35 | h2. Installation tools |
||
36 | 1 | Amber Herold | |
37 | Use the installation tools available for your linux distribution. |
||
38 | |||
39 | 2 | Amber Herold | * For example, Use yum utility to install. |
40 | * For example, Use the SuSE Linux YaST2 utility or zypper (openSuSE 10.2 and above) to install. |
||
41 | 10 | Amber Herold | * "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. |
42 | 1 | Amber Herold | |
43 | 11 | Amber Herold | h2. PHP, PHP-devel, gd, and fftw3 |
44 | 1 | Amber Herold | |
45 | Install the packages using your installation tools if available. For example, to install gd as php extension you may use |
||
46 | |||
47 | 11 | Amber Herold | <pre> |
48 | 1 | Amber Herold | CentOS> yum install php-gd |
49 | SuSE10.2 and above> zypper install php-gd |
||
50 | 11 | Amber Herold | </pre> |
51 | 1 | Amber Herold | |
52 | 6 | Amber Herold | h2. Configure php.ini |
53 | 1 | Amber Herold | |
54 | 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: |
||
55 | |||
56 | 11 | Amber Herold | <pre> |
57 | 1 | Amber Herold | register_argc_argv = On |
58 | |||
59 | short_open_tag = On |
||
60 | |||
61 | max_execution_time = 300 ; Maximum execution time of each script, in seconds |
||
62 | max_input_time = 300 ; Maximum amount of time each script may spend parsing request data |
||
63 | memory_limit = 256M ; Maximum amount of memory a script may consume (8MB) |
||
64 | 11 | Amber Herold | </pre> |
65 | 1 | Amber Herold | |
66 | 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. |
||
67 | |||
68 | 11 | Amber Herold | h2. Apache Web Server |
69 | |||
70 | 1 | Amber Herold | 1. Install the Apache Web Server with the YaST or yum utility. |
71 | |||
72 | 2. Find "httpd.conf". |
||
73 | 11 | Amber Herold | This is /etc/httpd/conf/httpd.conf on CentOS and /etc/php5/apache2/httpd.conf on SuSE |
74 | 1 | Amber Herold | |
75 | 7 | Amber Herold | 3. Edit the "httpd.conf" configuration file to look like the following: |
76 | 11 | Amber Herold | <pre> |
77 | DirectoryIndex index.htm index.shtm index.html index.shtml index.php |
||
78 | </pre> |
||
79 | 7 | Amber Herold | |
80 | 11 | Amber Herold | *Note:* It may be possible to edit httpd.conf in YaST2 as well. |
81 | 4 | Amber Herold | |
82 | 3 | Amber Herold | 4. Restart the web server. |
83 | 1 | Amber Herold | |
84 | <pre> |
||
85 | apachectl restart |
||
86 | or |
||
87 | /etc/init.d/httpd restart (ON CentOS) |
||
88 | or |
||
89 | /etc/init.d/apache2 restart (ON SuSE) |
||
90 | 11 | Amber Herold | </pre> |
91 | 1 | Amber Herold | |
92 | If you want to start the web server automatically at boot on SuSE |
||
93 | |||
94 | 11 | Amber Herold | <pre> |
95 | 3 | Amber Herold | SuSE >chkconfig apache2 on |
96 | 11 | Amber Herold | </pre> |
97 | 1 | Amber Herold | |
98 | 11 | Amber Herold | h2. Check php information |
99 | 1 | Amber Herold | |
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 | <pre> |
||
103 | <?php |
||
104 | 7 | Amber Herold | phpinfo(); |
105 | 1 | Amber Herold | ?> |
106 | </pre> |
||
107 | |||
108 | Visit this page at http://yourhost/info.php |
||
109 | |||
110 | 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. |
||
111 | |||
112 | 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. |
||
113 | 6 | Amber Herold | |
114 | 11 | Amber Herold | !http://emg.nysbc.org/software/leginon/images/images/phpini.png! |
115 | |||
116 | |||
117 | 1 | Amber Herold | h2. mrctools Installation |
118 | 7 | Amber Herold | |
119 | 12 | Amber Herold | mrctools is installed as a php extension and is required for displaying mrc files live on the web browser. |
120 | 1 | Amber Herold | |
121 | 11 | Amber Herold | h3. Install php-devel packages on the web server if missing: |
122 | |||
123 | 1 | Amber Herold | You can check whether php-devel is installed by typing |
124 | |||
125 | <pre> |
||
126 | >phpize |
||
127 | </pre> |
||
128 | |||
129 | 12 | Amber Herold | Follow the instructions for your specific Linux distribution. |
130 | 11 | Amber Herold | For example, SUSE users can use YaST or zypper to install them. |
131 | 1 | Amber Herold | |
132 | 11 | Amber Herold | h3. php-GD/FFTW3-devel |
133 | |||
134 | 12 | Amber Herold | Follow instructions from the download site. These may be included already. If not, the mrctools installation will fail. |
135 | 1 | Amber Herold | |
136 | 11 | Amber Herold | h3. mrctools Installation |
137 | 1 | Amber Herold | |
138 | 12 | Amber Herold | mrctools is installed from the php devel directory. This is usually located in /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. The location of the extension directory can be found by looking for "extension_dir" in http://your_host/info.php. |
139 | 11 | Amber Herold | |
140 | 12 | Amber Herold | 1. Download mrctools tools from http://emg.nysbc.org/software/mrctools. |
141 | 2. Follow the instructions at http://emg.nysbc.org/software/mrctools/mrc_so.php for installation and testing. The next section about checking php information can also help debugging the installation |
||
142 | 4 | Amber Herold | |
143 | 11 | Amber Herold | h3. Check php information |
144 | 1 | Amber Herold | |
145 | 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): |
||
146 | |||
147 | 11 | Amber Herold | !http://emg.nysbc.org/software/leginon/images/images/phpmrc.png! |
148 | |||
149 | If mrc is not listed, the extension did not get added in the right order. |
||
150 | |||
151 | h3. Alternative approach if mrc module does not show up in info.php output |
||
152 | 1 | Amber Herold | |
153 | 7 | 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/*). |
154 | 4 | Amber Herold | |
155 | 7 | Amber Herold | 2. Go to the directory and make a copy of any ini file to use as a template for mrc.ini |
156 | 3 | Amber Herold | |
157 | 1 | Amber Herold | <pre> |
158 | >cd [additional_ini_directory] |
||
159 | >cp gd.ini mrc.ini |
||
160 | 7 | Amber Herold | </pre> |
161 | 3 | Amber Herold | |
162 | 7 | Amber Herold | 3. Edit mrc.ini to the following |
163 | 3 | Amber Herold | |
164 | 1 | Amber Herold | <pre> |
165 | ; comment out next line to disable mrc extension in php |
||
166 | extension=mrc.so |
||
167 | 3 | Amber Herold | </pre> |
168 | 5 | Amber Herold | |
169 | 7 | Amber Herold | 4. Comment out mrc extension from php.ini (found in /etc/php.ini/ on a typical PHP installation) |
170 | 1 | Amber Herold | |
171 | 3 | Amber Herold | <pre> |
172 | 1 | Amber Herold | ;extension=mrc.so |
173 | 7 | Amber Herold | </pre> |
174 | 3 | Amber Herold | |
175 | 7 | Amber Herold | 5. restart your webserver |
176 | 1 | Amber Herold | |
177 | <pre> |
||
178 | > /etc/init.d/httpd restart |
||
179 | </pre> |
||
180 | 6 | Amber Herold | |
181 | h2. Web Interface (myamiweb) Linux Installation |
||
182 | 1 | Amber Herold | |
183 | php and java scripts for viewing images and Leginon information through the web server. |
||
184 | |||
185 | |||
186 | 7 | Amber Herold | 1. Move the myami/myamiweb directory to your Apache web directory |
187 | 6 | Amber Herold | |
188 | 3 | Amber Herold | Example: |
189 | 1 | Amber Herold | <pre> |
190 | 6 | Amber Herold | > cd [webdirectory] // /var/www/html in this example |
191 | > cp [path_to_myami_download_location]/myami/myamiweb . |
||
192 | 7 | Amber Herold | </pre> |
193 | 3 | Amber Herold | |
194 | 6 | Amber Herold | 2. Copy config.php.template to config.php and edit the latter by adding these MySQL parameters: |
195 | 7 | Amber Herold | "config.php" should be located in /var/www/html/myamiweb/ on CentOS and /srv/www/htdocs/myamiweb/ on SuSE. |
196 | 1 | Amber Herold | |
197 | 6 | Amber Herold | <pre> |
198 | <?php |
||
199 | 1 | Amber Herold | // --- define myamiweb tools base --- // |
200 | 6 | Amber Herold | |
201 | // This should be changed if the myamiweb directory is located |
||
202 | // in a sub-directory of the Apache web directory. |
||
203 | // ex. myamiweb is in /var/www/html/applications/myamiweb/ then |
||
204 | // change to define('BASE_PATH',"applications/myamiweb"); |
||
205 | 3 | Amber Herold | define('BASE_PATH',"myamiweb"); |
206 | 6 | Amber Herold | |
207 | // Administrator email address |
||
208 | 3 | Amber Herold | define('ADMIN_EMAIL', "example@scripps.edu"); |
209 | 6 | Amber Herold | |
210 | // --- Set your MySQL database server parameters |
||
211 | define('DB_HOST', "localhost"); // DB Host name |
||
212 | define('DB_USER', "usr_object"); // DB User name |
||
213 | define('DB_PASS', ""); // DB Password |
||
214 | define('DB_LEGINON', "leginondb"); // Leginon database name |
||
215 | 1 | Amber Herold | define('DB_PROJECT', "projectdb"); // Project database name |
216 | </pre> |
||
217 | 8 | Amber Herold | |
218 | * Enable the processing plug-in by uncommenting out the following line in the file`myamiweb/config.php` |
||
219 | |||
220 | <pre> |
||
221 | addplugin("processing"); |
||
222 | </pre> |
||
223 | |||
224 | * Copy `myamiweb/processing/config_processing.php.template` to `myamiweb/processing/config_processing.php` |
||
225 | * Edit `myamiweb/processing/config_processing.php` |
||
226 | |||
227 | <pre> |
||
228 | $PROCESSING_DB_HOST = "your_db_host"; |
||
229 | $PROCESSING_DB_USER = "usr_object"; |
||
230 | $PROCESSING_DB_PASS = ""; |
||
231 | $PROCESSING_DB = ""; |
||
232 | </pre> |
||
233 | |||
234 | Remember that the last line should be kept empty as this will be set dynamically. |
||
235 | We will not include the processing host or cluster registration now. It is covered in the last part of this document. |
||
236 | 6 | Amber Herold | |
237 | 1 | Amber Herold | 3. Test the set-up by visiting http://yourhost/myamiweb |