Project

General

Profile

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

Neil Voss, 08/14/2012 01:58 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 3 Anchi Cheng
# Assign redux server in myamiweb
16 2 Anchi Cheng
<pre>
17
define('SERVER_HOST',"your_hostname")
18
</pre>
19
20 3 Anchi Cheng
# Using Redux cache
21
** At myamiweb/config.php
22 2 Anchi Cheng
<pre>
23
define('USE_REDUX_CACHE',true)
24
</pre>
25 3 Anchi Cheng
** Turn it on or off in redux/pipeline.py
26
** Input the desired disk_cache_path, disk_cache_size, and mem_cache_size in the next few lines
27
** Create the disk_cache_path before running redux if cache will be used
28 7 Neil Voss
<pre>
29 8 Neil Voss
mkdir /tmp/redux
30
chmod 777 /tmp/redux
31 7 Neil Voss
</pre>
32 2 Anchi Cheng
33
h2. Test Installation
34
35
# Using Redux to do simple input output:
36
<pre>
37
cd /your_myami_download/redux/bin
38
redux --filename=test.jpg --oformat=PNG > test.png
39
</pre>
40
41
h2. Using redux server with myamiweb
42
# start redux server. (reduxd is in excutable path if installed)
43
<pre>
44
reduxd
45
</pre>
46
# test by accessing an image in myamiweb/imageviewer.php
47 5 Neil Voss
48
h2. run at boot
49
50
<pre>
51
sudo cp -v myami/redux/init.d/reduxd /etc/init.d/
52
sudo service reduxd start
53
</pre>
54 9 Neil Voss
55
h2. Test server
56
57
<pre>
58
redux --server_host=localhost \
59
 --filename=myami/redux/gst/example.png \
60
 --oformat=JPEG --shape=16,16 > test.jpg
61
</pre>