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