Project

General

Profile

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

Anchi Cheng, 10/19/2012 08:18 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
# Install redux prerequisites as found in its README file
7 4 Anchi Cheng
# Install myami-redux branch of myami on the webserver machine.  Redux needs write permission at its installation location to write fftw wisdom file.
8 2 Anchi Cheng
9 6 Neil Voss
<pre>
10
sudo easy_install fs
11
</pre>
12
13 2 Anchi Cheng
h2. Configurations:
14
15 16 Anchi Cheng
h3. configure redux
16 1 Anchi Cheng
<pre>
17 16 Anchi Cheng
> cd YourMyamDownload/redux
18
> cp redux.cfg.template redux.cfg
19 1 Anchi Cheng
</pre>
20 16 Anchi Cheng
You can also copy it to /etc/myami/redux.cfg if you prefer.
21 1 Anchi Cheng
22 16 Anchi Cheng
Customize redux.cfg.  For example, to turn on redux caching,
23 1 Anchi Cheng
<pre>
24 16 Anchi Cheng
[cache]
25
enable: yes
26
path: /var/cache/myami/redux
27
disksize:  500
28
memsize: 500
29 1 Anchi Cheng
</pre>
30 16 Anchi Cheng
*You need to make sure the cache path exists and writable by the user that starts the redux server (reduxd)*
31 3 Anchi Cheng
** Input the desired disk_cache_path, disk_cache_size, and mem_cache_size in the next few lines
32
** Create the disk_cache_path before running redux if cache will be used
33 16 Anchi Cheng
34
h3. Assign redux server in myamiweb
35
* At myamiweb/config.php
36 7 Neil Voss
<pre>
37 16 Anchi Cheng
define('SERVER_HOST',"localhost")
38 2 Anchi Cheng
</pre>
39
40 15 Jim Pulokas
h2. Test Installation
41
42
# 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.
43 2 Anchi Cheng
# Run the server:  run the following on a command line:<pre>reduxd</pre>leave it running for the following...
44 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)
45 2 Anchi Cheng
46 15 Jim Pulokas
h2. Using redux server with myamiweb
47 14 Jim Pulokas
48 15 Jim Pulokas
# start reduxd server if not already running from the above test:<pre>reduxd</pre>
49 10 Neil Voss
# click on "[test dataset]" on your main myamiweb home page, or go directly to the URL: myamiweb/viewerxml.php
50 15 Jim Pulokas
# test by accessing your own images from Leginon in myamiweb/imageviewer.php
51 11 Neil Voss
52
h2. starting reduxd at boot
53
54
<pre>
55
sudo cp -v myami/redux/init.d/reduxd /etc/init.d/
56 1 Anchi Cheng
sudo service reduxd start
57
</pre>