Project

General

Profile

Using Redux to serve images on myamiweb » History » Version 19

Amber Herold, 03/12/2013 03:47 PM

1 1 Anchi Cheng
h1. Using Redux to serve images on myamiweb
2
3
h2. Installation
4
5
# Follow [[Web_Server_Installation]] but ignore warning on not using php 5.3
6 17 Anchi Cheng
# Install myami-redux branch of myami on the webserver machine.
7
** Install redux prerequisites as found in its README file
8
** Redux needs write permission at its installation location to write fftw wisdom file.
9
** Install python filesystem abstraction for redux caching like this:
10 6 Neil Voss
<pre>
11
sudo easy_install fs
12
</pre>
13
14 1 Anchi Cheng
h2. Configurations:
15
16 16 Anchi Cheng
h3. configure redux
17 17 Anchi Cheng
18 1 Anchi Cheng
<pre>
19 17 Anchi Cheng
> cd /YourMyamDownload/redux
20 16 Anchi Cheng
> cp redux.cfg.template redux.cfg
21 1 Anchi Cheng
</pre>
22 17 Anchi Cheng
* You can also copy it to /etc/myami/redux.cfg if you prefer.
23 1 Anchi Cheng
24 17 Anchi Cheng
* Turn on redux caching if desired,
25 1 Anchi Cheng
<pre>
26 16 Anchi Cheng
[cache]
27
enable: yes
28
path: /var/cache/myami/redux
29
disksize:  500
30
memsize: 500
31 1 Anchi Cheng
</pre>
32
*You need to make sure the cache path exists and writable by the user that starts the redux server (reduxd)*
33 16 Anchi Cheng
** Input the desired disk_cache_path, disk_cache_size, and mem_cache_size in the next few lines
34 3 Anchi Cheng
** Create the disk_cache_path before running redux if cache will be used
35
36 16 Anchi Cheng
h3. Assign redux server in myamiweb
37 17 Anchi Cheng
38 16 Anchi Cheng
* At myamiweb/config.php
39 7 Neil Voss
<pre>
40 16 Anchi Cheng
define('SERVER_HOST',"localhost")
41 2 Anchi Cheng
</pre>
42
43 15 Jim Pulokas
h2. Test Installation
44
45
# Using Redux to do simple input output (simple client with no reduxd server needed):<pre>redux --filename=test.jpg --oformat=PNG > test.png</pre>Make sure the resulting test.png is in fact an image and not an error message.
46 2 Anchi Cheng
# Run the server:  run the following on a command line:<pre>reduxd</pre>leave it running for the following...
47 12 Gabriel Lander
# Test command line client connecting to the server<pre>redux --server_host=localhost --filename=test.jpg --oformat=PNG > test.png</pre>Note: The input file name is from the perspective of the reduxd server, so be sure to give it an absolute path (unlike the first test, which was not accessing the server)
48 2 Anchi Cheng
49 15 Jim Pulokas
h2. Using redux server with myamiweb
50 14 Jim Pulokas
51 15 Jim Pulokas
# start reduxd server if not already running from the above test:<pre>reduxd</pre>
52 10 Neil Voss
# click on "[test dataset]" on your main myamiweb home page, or go directly to the URL: myamiweb/viewerxml.php
53 15 Jim Pulokas
# test by accessing your own images from Leginon in myamiweb/imageviewer.php
54 11 Neil Voss
55
h2. starting reduxd at boot
56
57
<pre>
58
sudo cp -v myami/redux/init.d/reduxd /etc/init.d/
59 1 Anchi Cheng
sudo service reduxd start
60
</pre>
61 18 Anchi Cheng
62 19 Amber Herold
[[leginon:Using imcache to cache mrc images as jpeg images of the default size on myamiweb]]