Project

General

Profile

MAUSDjangoApache » History » Version 25

Jackson, Mike, 06 March 2012 16:59

1 18 Jackson, Mike
h1. Deploying the MAUS web-front end
2 1 Jackson, Mike
3
{{>toc}}
4
5 22 Jackson, Mike
This page describes how to install and run the MAUS web front-end. 
6 21 Jackson, Mike
7
* The web front-end can either be run in the Django lightweight web server or under Apache 2.0. The latter is recommended for production environments.
8 22 Jackson, Mike
* The MAUS software is *not* required to use the MAUS web front-end. However, if you do not have MAUS then you will need to install Python 2.7 and related packages.
9 21 Jackson, Mike
10 22 Jackson, Mike
h2. Install Python 2.7 and related packages
11 16 Jackson, Mike
12 22 Jackson, Mike
If you have downloaded and built the MAUS software (which comes with Python 2.7 and Python setuptools) then *go down to Install ImageMagick*.
13 14 Jackson, Mike
14 22 Jackson, Mike
To install Python (2.7.2) by building it from its source code:
15 14 Jackson, Mike
16 22 Jackson, Mike
* Log in as a super-user by using @sudo su -@ or @su@.
17
* Get the Python 2.7 source distribution and unpack it,
18 14 Jackson, Mike
<pre>
19
$ wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
20
$ mv Python-2.7.2.tgz Python-2.7.2.tar.gz
21
$ gunzip Python-2.7.2.tar.gz 
22
$ tar -xf Python-2.7.2.tar 
23
$ cd Python-2.7.2
24
</pre>
25
* Configure,
26
<pre>
27 1 Jackson, Mike
$ ./configure
28 14 Jackson, Mike
</pre>
29 1 Jackson, Mike
* Build,
30 14 Jackson, Mike
<pre>
31 1 Jackson, Mike
$ make
32
</pre>
33 14 Jackson, Mike
* Install,
34
<pre>
35
$ make install
36
</pre>
37 15 Jackson, Mike
38 22 Jackson, Mike
For more information, see http://www.python.org/getit/releases/2.7//
39 1 Jackson, Mike
40 22 Jackson, Mike
h3. Install Python setuptools
41 14 Jackson, Mike
42 22 Jackson, Mike
Python setuptools (http://pypi.python.org/pypi/setuptools) is a suite of useful Python configuration tools. Foremost amongst these is @easy_install@ which supports straightforward installation of Python packages.
43
44
To install Python setuptools (0.6c11) for Python 2.7:
45
46
* Log in as a super-user by using @sudo su -@ or @su@.
47 14 Jackson, Mike
* Get the setuptools egg,
48
<pre>
49 1 Jackson, Mike
$ wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
50
</pre>
51
* Execute the egg,
52 14 Jackson, Mike
<pre>
53 1 Jackson, Mike
$ sh setuptools-0.6c11-py2.7.egg 
54
</pre>
55
56 22 Jackson, Mike
h2. Install ImageMagick
57 1 Jackson, Mike
58 22 Jackson, Mike
The ImageMagick library (http://www.imagemagick.org/script/index.php) is used to convert between image types. 
59 16 Jackson, Mike
60 22 Jackson, Mike
Check to see if you already have this, as it is a commonly installed tool,
61 16 Jackson, Mike
<pre>
62
$ /usr/local/bin/convert -h
63
Version: ImageMagick 6.7.4-0 2011-12-13 Q16 http://www.imagemagick.org
64
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
65
Features: OpenMP    
66
</pre>
67
68 22 Jackson, Mike
If so then *go down to Install Django, MagickWand and Python Image Library packages*.
69 14 Jackson, Mike
70 22 Jackson, Mike
To install ImageMagick (6.7.4),
71
72
* Log in as a super-user by using @sudo su -@ or @su@.
73 14 Jackson, Mike
* Get and unpack ImageMagick,
74
<pre>
75
$ wget http://www.imagemagick.org/download/ImageMagick.tar.gz
76
$ gunzip ImageMagick.tar.gz
77
$ tar -xf ImageMagick.tar
78
$ cd ImageMagick-6.7.4-0/
79
</pre>
80
* Configure,
81
<pre>
82
$ ./configure
83
</pre>
84 1 Jackson, Mike
* Make,
85
<pre>
86
$ make
87
</pre>
88
* Install,
89
<pre>
90 14 Jackson, Mike
$ make install
91
</pre>
92
** This places libraries in @/usr/local/lib@.
93
* Cache the libraries,
94
<pre>
95
$ ldconfig /usr/local/lib
96 1 Jackson, Mike
</pre>
97
** This avoids problems with libraries not being found by Python's magickwand library.
98 14 Jackson, Mike
* Check,
99
<pre>
100
$ /usr/local/bin/convert -h
101
Version: ImageMagick 6.7.4-0 2011-12-13 Q16 http://www.imagemagick.org
102
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
103 1 Jackson, Mike
Features: OpenMP    
104
</pre>
105
106 22 Jackson, Mike
h2. Install Django, MagickWand and Python Image Library packages
107 1 Jackson, Mike
108 22 Jackson, Mike
* Django (https://www.djangoproject.com/) is a Python package for developing web applications.
109
* MagickWand (http://pypi.python.org/pypi/magickwand) is a Python package allowing ImageMagick to be used from within Python.
110
* Python Image Library (http://www.pythonware.com/products/pil/) is a package of image manipulation utilities.
111 16 Jackson, Mike
112 22 Jackson, Mike
To install the current versions of these Python packages using @easy_install@:
113
114
* If you have installed Python 2.7 as a super-user (and are not using the version bundled with MAUS) then, log in as a super-user by using @sudo su -@ or @su@.
115 14 Jackson, Mike
* Run,
116 1 Jackson, Mike
<pre>
117
$ easy_install django
118
$ easy_install magickwand
119
$ easy_install pil
120
</pre>
121
122 22 Jackson, Mike
Check MagickWand:
123
124 23 Jackson, Mike
* Start Python,
125 14 Jackson, Mike
<pre>
126 16 Jackson, Mike
$ python
127 14 Jackson, Mike
$ import magickwand
128
$ from magickwand.image import Image
129
...
130
</pre>
131
* If you get an error like,
132
<pre>
133
Traceback (most recent call last):
134 1 Jackson, Mike
  File "<stdin>", line 1, in <module>
135
  File "build/bdist.linux-i686/egg/magickwand/image.py", line 2, in <module>
136
  File "build/bdist.linux-i686/egg/magickwand/api/__init__.py", line 1, in <module>
137
    #
138 14 Jackson, Mike
  File "build/bdist.linux-i686/egg/magickwand/api/lib.py", line 11, in <module>
139
  File "/home/user/maus/third_party/install/lib/python2.7/ctypes/__init__.py", 
140
  line 353, in __init__ self._handle = _dlopen(self._name, mode)
141 20 Jackson, Mike
OSError: libMagickWand.so.5: cannot open shared object file: 
142 14 Jackson, Mike
 No such file or directory
143
</pre>
144 22 Jackson, Mike
* then run @ldconfig@ as described in Install ImageMagick above.
145 14 Jackson, Mike
146 22 Jackson, Mike
h2. Install Apache 2.2
147 16 Jackson, Mike
148 22 Jackson, Mike
Apache 2.2 (http://httpd.apache.org/) is an HTTP server. 
149 16 Jackson, Mike
150 22 Jackson, Mike
If you do *not* want to use Apache 2 but are happy to use the stand-alone lightweight Django web server then *go down to Install the MAUS web front-end*.
151 19 Jackson, Mike
152 22 Jackson, Mike
To install Apache 2.2,
153
154
* Log in as a super-user by using @sudo su -@ or @su@.
155 1 Jackson, Mike
* Download,
156
<pre>
157
$ wget http://mirrors.ukfast.co.uk/sites/ftp.apache.org//httpd/httpd-2.2.22.tar.gz
158
</pre>
159
* Extract,
160
<pre>
161
$ gzip -d httpd-2.2.22.tar.gz 
162
$ tar xvf httpd-2.2.22.tar
163
$ cd httpd-2.2.22
164
</pre>
165
* Configure,
166
<pre>
167
$ ./configure
168
</pre>
169 22 Jackson, Mike
** This uses a default installation directory of @/usr/local/apache2@.
170 1 Jackson, Mike
* Compile,
171
<pre>
172
$ make 
173
</pre>
174
* Install,
175
<pre>
176
$ make install 
177
</pre>
178
* Start-up server,
179
<pre>
180
$ /usr/local/apache2/bin/apachectl -k start
181
</pre>
182
** If you get an error like,
183
<pre>
184
(98)Address already in use: make_sock: could not bind to address [::]:80
185
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
186
no listening sockets available, shutting down
187
Unable to open logs
188
</pre>
189 22 Jackson, Mike
** Then edit @/usr/local/apache2/conf/httpd.conf@ and change,
190 1 Jackson, Mike
<pre>
191
Listen 80 
192
</pre>
193
** to a port that is not in use e.g.
194
<pre>
195
Listen 9090
196
</pre>
197 22 Jackson, Mike
** and try to start Apache again as described above.
198 1 Jackson, Mike
* Browse to http://localhost:8080 (or whatever port you specified above) and you should see @It works!"@
199
200 22 Jackson, Mike
More information:
201 1 Jackson, Mike
202 22 Jackson, Mike
* Apache 2 configuration file: @/usr/local/apache2/conf/httpd.conf@
203 1 Jackson, Mike
* Error log: @/usr/local/apache2/logs/error_log@
204 22 Jackson, Mike
* Installation instructions: http://httpd.apache.org/docs/current/install.html
205 1 Jackson, Mike
206 22 Jackson, Mike
h2. Install mod_wsgi
207 1 Jackson, Mike
208 22 Jackson, Mike
mod_wsgi (http://code.google.com/p/modwsgi/) is an Apache module allowing the hosting of Python applications which suppport Python's WSGI (Web Server Gateway Interface). 
209 1 Jackson, Mike
210 22 Jackson, Mike
To install mod_wsgi (July 2010 release) under Apache 2.2,
211
212 24 Jackson, Mike
* Log in as a super-user by using @sudo su -@ or @su@.
213 22 Jackson, Mike
* Download release,
214 1 Jackson, Mike
<pre>
215
$ wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
216
</pre>
217
* Extract,
218
<pre>
219
$ gunzip mod_wsgi-3.3.tar.gz 
220
$ tar -xf mod_wsgi-3.3.tar
221
$ cd mod_wsgi-3.3
222
</pre>
223
* Set Python library path,
224 24 Jackson, Mike
** If you are *not* using the MAUS software to provide Python 2.7, then skip this step.
225
** If you *are* using the MAUS software to provide Python 2.7, then set @LD_PYTHON_PATH@ to the location of its libraries e.g.:
226 1 Jackson, Mike
<pre>
227 17 Jackson, Mike
$ export LD_LIBRARY_PATH=/home/user/maus/third_party/install/lib/
228 1 Jackson, Mike
</pre>
229
* Configure,
230 22 Jackson, Mike
** If you installed Python 2.7 then run,
231 1 Jackson, Mike
<pre>
232
$ ./configure --with-apxs=/usr/local/apache2/bin/apxs
233
</pre>
234 24 Jackson, Mike
** If you *are* using the MAUS software to provide Python 2.7, you need to provide the path, so run,
235 17 Jackson, Mike
<pre>
236
$ ./configure --with-apxs=/usr/local/apache2/bin/apxs
237
  --with-python=/home/user/maus/third_party/install/bin/python2.7
238
</pre>
239 1 Jackson, Mike
** If you get an error like:
240
<pre>
241 17 Jackson, Mike
/home/user/maus/third_party/install/bin/python2.7: error while loading 
242 1 Jackson, Mike
shared libraries: libpython2.7.so.1.0: cannot open shared object file: 
243
No such file or directory
244
</pre>
245 22 Jackson, Mike
** then set the @LD_LIBRARY_PATH@ as above.
246 1 Jackson, Mike
** If you get an error like:
247
<pre>
248
checking for apxs2... no
249
checking for apxs... no
250
checking Apache version... ./configure: line 1704: apxs: command not found
251
./configure: line 1704: apxs: command not found
252
./configure: line 1705: apxs: command not found
253
./configure: line 1708: /: is a directory
254
255 17 Jackson, Mike
checking for python... /home/user/maus/third_party/install/bin/python
256 1 Jackson, Mike
./configure: line 1877: apxs: command not found
257
configure: creating ./config.status
258
config.status: error: cannot find input file: Makefile.in
259
</pre>
260 22 Jackson, Mike
** then you forgot to provide the path to Apache's @apxs@ command,
261 1 Jackson, Mike
* Compile,
262
<pre>
263
$ make
264
</pre>
265
* Install,
266
<pre>
267
$ make install
268
</pre>
269
* A @mod_wsgi.so@ library is installed in @/usr/local/apache2/modules@.
270 22 Jackson, Mike
* Configure Apache:
271
** Edit @/usr/local/apache2/conf/httpd.conf@
272
** Look for the comment,
273 1 Jackson, Mike
<pre>
274 22 Jackson, Mike
# Example
275
# LoadModule foo_module modules/mod_foo.so
276
#
277 1 Jackson, Mike
</pre>
278 22 Jackson, Mike
** Under this comment, add,
279 1 Jackson, Mike
<pre>
280 17 Jackson, Mike
LoadModule wsgi_module modules/mod_wsgi.so
281
</pre>
282 22 Jackson, Mike
* Set the @LD_LIBRARY_PATH@ in the Apache environment,
283 24 Jackson, Mike
** If you are *not* using the MAUS software to provide Python 2.7, then skip this step. 
284
** If you *are* using the MAUS software to provide Python 2.7, then set @LD_PYTHON_PATH@ to the location of its libraries,
285
*** Edit @/usr/local/apache2/bin/envvars@ and insert your path on a line before the @export LD_LIBRARY_PATH@ line, so the file becomes
286 1 Jackson, Mike
<pre>
287 22 Jackson, Mike
LD_LIBRARY_PATH="/usr/local/apache2/lib:$LD_LIBRARY_PATH" 
288 17 Jackson, Mike
LD_LIBRARY_PATH="/home/user/maus/third_party/install/lib/:$LD_LIBRARY_PATH" 
289 22 Jackson, Mike
export LD_LIBRARY_PATH
290 1 Jackson, Mike
</pre>
291 22 Jackson, Mike
*** Ensure that the permissions in your path allow group and world read and execute permission (755),
292 17 Jackson, Mike
<pre>
293 1 Jackson, Mike
$ chmod go+rx /home/user
294
</pre>
295
* Restart Apache,
296
<pre>
297
$ /usr/local/apache2/bin/apachectl restart
298
</pre>
299 22 Jackson, Mike
* If all is well you should see, in @/usr/local/apache2/logs/error_log@, a line like,
300 1 Jackson, Mike
<pre>
301
[Tue Feb 07 18:50:37 2012] [notice] Apache/2.2.22 (Unix) mod_wsgi/3.3 
302
Python/2.7.2 configured -- resuming normal operations
303
</pre>
304
* If you see an error like,
305
<pre>
306 2 Jackson, Mike
[Tue Feb 07 18:46:40 2012] [notice] SIGHUP received.  Attempting to restart
307
httpd: Syntax error on line 55 of /usr/local/apache2/conf/httpd.conf: Cannot 
308
load /usr/local/apache2/modules/mod_wsgi.so into server: 
309
libpython2.7.so.1.0: cannot open shared object file: No such file or directory
310
</pre>
311
** then you have to set the @LD_LIBRARY_PATH@ as above.
312 1 Jackson, Mike
* If you see an error like,
313
<pre>
314
Could not find platform independent libraries <prefix>
315
Could not find platform dependent libraries <exec_prefix>
316
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
317
ImportError: No module named site
318
</pre>
319
** then it is likely you did not set the file permissions for the directory in which Python is as described above.
320
* Clean up,
321 2 Jackson, Mike
<pre>
322
$ make clean
323 1 Jackson, Mike
</pre>
324
325 22 Jackson, Mike
To check your installation,
326 1 Jackson, Mike
327
* List server information,
328
<pre>
329
$ /usr/local/apache2/bin/httpd  -V
330
Server version: Apache/2.2.22 (Unix)
331
...
332
Server MPM:     Prefork
333 2 Jackson, Mike
  threaded:     no
334 1 Jackson, Mike
    forked:     yes (variable process count)
335
Server compiled with....
336
 -D APACHE_MPM_DIR="server/mpm/prefork"
337
...
338
</pre>
339
** Important information is the version and prefork settings,
340
* List compiled-in modules,
341
<pre>
342
$ /usr/local/apache2/bin/httpd  -l
343
Compiled in modules:
344
...
345
  prefork.c
346
</pre>
347
** You should see @prefork.c@.
348
* List dynamically-loaded modules,
349
<pre>
350
$ /usr/local/apache2/bin/httpd  -M
351
 mpm_prefork_module (static)
352
 ...
353
 wsgi_module (shared)
354
 ...
355 2 Jackson, Mike
</pre>
356 1 Jackson, Mike
** You should see @wsgi_module@.
357
** If this fails with,
358
<pre>
359
httpd: Syntax error on line 55 of /usr/local/apache2/conf/httpd.conf: 
360
Cannot load /usr/local/apache2/modules/mod_wsgi.so into server: 
361
libpython2.7.so.1.0: cannot open shared object file: No such file or directory
362
</pre>
363
** Then set your @LD_LIBRARY_PATH@ as above and try again,
364 2 Jackson, Mike
<pre>
365
$ export LD_LIBRARY_PATH="/home/user/maus/third_party/install/lib/:$LD_LIBRARY_PATH"
366
$ /usr/local/apache2/bin/httpd -M
367
Loaded Modules:
368
...
369
</pre>
370
* List modules linked to by @mod_wsgi@:
371
<pre>
372
$ ldd /usr/local/apache2/modules/mod_wsgi.so
373
...
374 1 Jackson, Mike
libpython2.7.so.1.0 => /home/user/maus/third_party/install/lib/libpython2.7.so.1.0 
375 2 Jackson, Mike
(0x00110000)
376
...
377
</pre>
378
** You should see the link to your Python library.
379
380 22 Jackson, Mike
More information:
381 2 Jackson, Mike
382 22 Jackson, Mike
* http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
383
* http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation
384
* http://code.google.com/p/modwsgi/wiki/InstallationInstructions
385
* http://code.google.com/p/modwsgi/wiki/InstallationIssues
386
387
h2. Install the MAUS web front-end
388 1 Jackson, Mike
389 22 Jackson, Mike
Check-out the MAUS Django code,
390 2 Jackson, Mike
<pre>
391
$ bzr branch -v lp:~michaelj-h/maus-apps/devel maus-apps
392 22 Jackson, Mike
$ cd maus-apps
393 2 Jackson, Mike
</pre>
394 22 Jackson, Mike
395 24 Jackson, Mike
You can either run the MAUS web front-end under the Django web server or under Apache 2.
396 22 Jackson, Mike
397
h2. Run the web front-end under the Django web server
398
399
* Create the environment script,
400
** If you are *not* using the MAUS software to provide Python 2.7:
401 1 Jackson, Mike
<pre>
402
$ ./configure
403
</pre>
404 22 Jackson, Mike
** If you *are*  using the MAUS software to provide Python 2.7:
405 20 Jackson, Mike
<pre>
406 22 Jackson, Mike
$ ./configure --with-maus
407 1 Jackson, Mike
</pre>
408 22 Jackson, Mike
* Set up the environment,
409
** If you *are* using the MAUS software to provide Python 2.7 then set up the MAUS environment as described in the MAUS user guide, e.g.
410
<pre>
411
$ source /home/user/maus/env.sh
412
</pre>
413
** Set up the MAUS web front-end environment:
414
<pre>
415
$ source env.sh
416
</pre>
417
* Start the Django web server. Run:
418
<pre>
419
$ python src/mausweb/manage.py runserver HOST:PORT
420
</pre>
421
** where @HOST@ is your host name and @PORT@ is the port on which the web server listens. For example
422 1 Jackson, Mike
<pre>
423 22 Jackson, Mike
$ python src/mausweb/manage.py runserver localhost:9000
424 1 Jackson, Mike
</pre>
425
** or,
426
<pre>
427 22 Jackson, Mike
$ python src/mausweb/manage.py runserver maus.epcc.ed.ac.uk:9000
428
</pre>
429
430
h2. Run the web front-end under the Apache web server
431
432 24 Jackson, Mike
* Create the environment script,
433
** If you are *not* using the MAUS software to provide Python 2.7:
434 2 Jackson, Mike
<pre>
435 24 Jackson, Mike
$ ./configure
436 2 Jackson, Mike
</pre>
437 24 Jackson, Mike
** If you *are*  using the MAUS software to provide Python 2.7:
438 1 Jackson, Mike
<pre>
439 24 Jackson, Mike
$ ./configure --with-maus
440 2 Jackson, Mike
</pre>
441 24 Jackson, Mike
* Log in as a super-user by using @sudo su -@ or @su@.
442
* Set the paths in the Apache environment, edit @/usr/local/apache2/bin/envvars@:
443
** If you are *not* using the MAUS software to provide Python 2.7, then add, on a line before the @export LD_LIBRARY_PATH@ line, a command to sources the MAUS web front-end @env.sh@ script e.g.:
444 2 Jackson, Mike
<pre>
445 24 Jackson, Mike
source /home/user/maus-apps/env.sh
446 1 Jackson, Mike
</pre>
447 24 Jackson, Mike
** If you *are* using the MAUS software to provide Python 2.7, then add, on lines before the @export LD_LIBRARY_PATH@ line, commands to sources the MAUS software and MAUS web front-end @env.sh@ scripts e.g.:
448 1 Jackson, Mike
<pre>
449 24 Jackson, Mike
source /home/user/maus/env.sh
450
source /home/user/maus-apps/env.sh
451 1 Jackson, Mike
</pre>
452 24 Jackson, Mike
** Ensure that the permissions in your path allow group and world read and execute permission (755) to these scripts e.g.,
453 1 Jackson, Mike
<pre>
454 24 Jackson, Mike
$ chmod go+rx /home/user
455 1 Jackson, Mike
</pre>
456 24 Jackson, Mike
* Edit the Apache 2 configuration, @/usr/local/apache2/conf/httpd.conf@ and add to the end of the file:
457 2 Jackson, Mike
<pre>
458 3 Jackson, Mike
WSGIScriptAlias / ${MAUS_WEB_DIR}/apache/django.wsgi  
459 17 Jackson, Mike
 
460 6 Jackson, Mike
<Directory ${MAUS_WEB_DIR}/apache> 
461 8 Jackson, Mike
Order deny,allow  
462 4 Jackson, Mike
Allow from all  
463 6 Jackson, Mike
</Directory> 
464 3 Jackson, Mike
</pre>
465 24 Jackson, Mike
** For your information,
466
*** @/@ specifies the root URL - so all URL requests will be directed to Django.
467
*** @/...@ - location of WSGI file within the MAUS Django project.
468 3 Jackson, Mike
* Restart Apache 2.2,
469 2 Jackson, Mike
<pre>
470
$ /usr/local/apache2/bin/apachectl restart
471
</pre>
472
473 25 Jackson, Mike
For information on running Django under Apache 2.2/mod_wsgi, see:
474
* https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi
475
* http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
476 8 Jackson, Mike
477 25 Jackson, Mike
h2. Test your installation
478 8 Jackson, Mike
479 22 Jackson, Mike
* Copy a couple of sample images,
480 24 Jackson, Mike
<pre>
481
$ cp images/* media/raw
482
</pre>
483 25 Jackson, Mike
* Browse to the URL @http://HOST:PORT/maus@ where @HOST@ is your host name and @PORT@ is the port on which the web server listens. For example @http://localhost:80/maus/@
484 24 Jackson, Mike
485 25 Jackson, Mike
h1. Supported images 
486
487
Currently the MAUS web front-end supports any image formats with extensions supported by Matplotlib or 
488 24 Jackson, Mike
PyROOT and handled by MagickWand image converter: 
489 25 Jackson, Mike
490
* PostScript: "ps"
491
* Enhanced PostScript: "eps"
492
* PNG: "png"
493
* PDF: "pdf" 
494
* GIF: "gif"
495
* JPEG: "jpg", "jpeg"