Project

General

Profile

Using Redux to serve images on myamiweb » History » Revision 21

Revision 20 (Amber Herold, 03/13/2013 10:04 AM) → Revision 21/64 (Amber Herold, 03/13/2013 10:10 AM)

h1. Using Redux to serve images on myamiweb 

 *Before you begin:* 
 Redux is new for CentOS 6 (PHP 5.3).  
 If you want to install *Appion/Leginon 2.2 on CentOS 5*, you do not need to install Redux. Instead, you must follow the directions to [[Install the MRC PHP Extension]]. 

 h2. Installation 

 # Follow [[Web_Server_Installation]] but ignore warning on not using php 5.3 
 # Install myami-redux branch of myami on the webserver machine. 
 ** Install redux prerequisites as found in its README file 
 ** Redux needs write permission at its installation location to write fftw wisdom file. 
 ** Install python filesystem abstraction for redux caching like this: 
 <pre> 
 sudo easy_install fs 
 </pre> 

 h2. Configurations: 

 h3. configure redux 

 <pre> 
 > cd /YourMyamDownload/redux 
 > cp redux.cfg.template redux.cfg 
 </pre> 
 * You can also copy it to /etc/myami/redux.cfg if you prefer. 

 * Turn on redux caching if desired, 
 <pre> 
 [cache] 
 enable: yes 
 path: /var/cache/myami/redux 
 disksize:    500 
 memsize: 500 
 </pre> 
 *You need to make sure the cache path exists and writable by the user that starts the redux server (reduxd)* 
 ** Input the desired disk_cache_path, disk_cache_size, and mem_cache_size in the next few lines 
 ** Create the disk_cache_path before running redux if cache will be used 

 h3. Assign redux server in myamiweb 

 * At myamiweb/config.php 
 <pre> 
 define('SERVER_HOST',"localhost") 
 </pre> 

 h2. Test Installation 

 # 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. 
 # Run the server:    run the following on a command line:<pre>reduxd</pre>leave it running for the following... 
 # 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) 

 h2. Using redux server with myamiweb 

 # start reduxd server if not already running from the above test:<pre>reduxd</pre> 
 # click on "[test dataset]" on your main myamiweb home page, or go directly to the URL: myamiweb/viewerxml.php 
 # test by accessing your own images from Leginon in myamiweb/imageviewer.php 

 h2. starting reduxd at boot 

 <pre> 
 sudo cp -v myami/redux/init.d/reduxd /etc/init.d/ 
 sudo service reduxd start 
 </pre> 

 {{include(leginon:Using imcache to cache mrc images as jpeg images of the default size on myamiweb)}}