Creating a minimally viable CentOS OpenLogic rapache instance

Feb 16 2014No Comments Azure, centos, rapache by justin
Recently I've been dealing with R and rapache at work. R is a language for statisticians. rapache is an apache module for executing R scripts in apache. Its like mod_perl or mod_php for R. I've been writing simple RESTful scripts that return graphics and JSON, and calling them from static html pages. I've been also using my MSDN Azure subscription to engage in R self study at home. In the spirit of my last post, I've posted the setup notes here to get you stated with a new Azure VM for running an rapache instance. Azure used a special cloud enabled version fo CentoS 6.3 called OpenLogic. However, it seems to work similarly to the vanilla CentoOS 6.4 instances I've used at work. So everything should apply there. If something doesn't work leave a comment.
  • First, CentOS is very conservative, but Fedora makes EPEL to give you a more modern set of RPMs
    • rpm -Uvh http://epel.mirror.freedomvoice.com/6/i386/epel-release-6-8.noarch.rpm
  • Now lets install the packages we need. The kernel will be updated, so we will need to reboot.
    • yum update -y
    • yum install -y vim-x11 vim-enhanced xauth R terminator xterm rxvt R httpd git httpd-devel gcc cairo cairo-devel libXt-devel
    • yum groupinstall -y fonts
    • ldconfig
    • shutdown -r now
  • Now as a regular user lets compile rapache.
    • mkdir ~/src
    • cd ~/src
    • git checkout https://github.com/jeffreyhorner/rapache.git
    • cd rapache
    • ./configure && make && sudo make install
  • Now lets configure rapache. Create a file called /etc/httpd/conf.d/rapache.conf with the following:
# rapache configuration by Justin Dearing <zippy1981@gmail.com>
LoadModule R_module modules/mod_R.so
<Location /RApacheInfo>
 SetHandler r-info
</Location>
AddHandler r-script .R
RHandler sys.source
  • Now restart apache.  Make sure it't working by running 
    elinks http://localhost/RApacheInfo.
Azure doesn't configure swap space by default. You're going to absolutely need some swap space if you're using an extra small instance. A good howto for that is here.

0 Responses to 'Creating a minimally viable CentOS OpenLogic rapache instance'

You must be authenticated in order to add a comment.