1

I have installed Rapache using the below code:

apt-get install r-base-dev apache2-mpm-prefork apache2-prefork-dev
wget http://www.rapache.net/rapache-1.2.3.tar.gz 
tar xzvf rapache-1.2.3.tar.gz
cd rapache-1.2.3
./configure 
make
make install   

Then at /var/www/html folder I have added a r script called test.R file with below code:

<%
print(rnorm(100))
%>

Made changes to .conf file at /etc/apache2/sites-available as below:

<VirtualHost *:80>       


LoadModule R_module /usr/lib/apache2/modules/mod_R.so
    ServerName 5*.2**.***.**
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ROutputErrors

    <Location /RApacheInfo>
    SetHandler r-info
    </Location>

    <Location /var/www/html>
    SetHandler r-script
    RHandler sys.source
    </Location>    

</VirtualHost>

when I run the browser http://localhost/test.R

I'm just getting print(rnorm(100)) instead of proper results like:

[1] -0.42690476 -0.08042903 -1.12774910  1.09807142  0.05778597  1.76122503  0.46055559  0.81081209 -2.30502371
[10]  0.91361172

Is there something which I'm missing?

  • The issue is fixed by following steps: 1) installed brew R package. 2)changed "Location" to "Directory" 3) changed "SetHandler r-handler" to "SetHandler r-script" 4) changed the "RFileHandler" line to "RHandler brew::brew" 5) restarted Apache – Suresh Gorakala Sep 19 '14 at 01:46

0 Answers0