Using Redux to serve images on myamiweb » History » Version 14
Jim Pulokas, 10/05/2012 02:19 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 | 13 | Jim Pulokas | |
| 43 | 12 | Gabriel Lander | # start redux server. (reduxd is in executable path if installed) |
| 44 | 2 | Anchi Cheng | <pre> |
| 45 | reduxd |
||
| 46 | </pre> |
||
| 47 | 14 | Jim Pulokas | # click on "[test dataset]" on your main myamiweb home page, or go directly to the URL: myamiweb/viewerxml.php |
| 48 | 2 | Anchi Cheng | # test by accessing an image in myamiweb/imageviewer.php |
| 49 | 5 | Neil Voss | |
| 50 | h2. run at boot |
||
| 51 | |||
| 52 | <pre> |
||
| 53 | sudo cp -v myami/redux/init.d/reduxd /etc/init.d/ |
||
| 54 | sudo service reduxd start |
||
| 55 | </pre> |
||
| 56 | 9 | Neil Voss | |
| 57 | h2. Test server |
||
| 58 | |||
| 59 | <pre> |
||
| 60 | redux --server_host=localhost \ |
||
| 61 | --filename=myami/redux/gst/example.png \ |
||
| 62 | 10 | Neil Voss | --oformat=JPEG --shape=32,32 > test.jpg |
| 63 | |||
| 64 | identify test.jpg |
||
| 65 | 9 | Neil Voss | </pre> |
| 66 | 11 | Neil Voss | |
| 67 | result |
||
| 68 | <pre> |
||
| 69 | test.jpg JPEG 32x32 32x32+0+0 8-bit DirectClass 1.03kb |
||
| 70 | </pre> |