Installing RApache on Mac OS X Snow Leopard

[This article was first published on World of R-Craft, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Hi Folks,
for a research project I needed to install RApache on my Mac OS X 10.6.4 (Snow Leopard) machine.

It did take some time, a lot of beeping in the video documentary, a lot of recompiles…

Here is the way to do it:

1. Install Gnu Fortran on your Mac

You need to install Gnu Fortran on your Mac, because you have to build R on your Mac to run RApache.

Fortunately, there is a nicely Mac-style installer available at

Go ahead and install it.

2. Install libapreq on your Mac

libapreq2 is a library for your Apache 2 installation. Download libapreq2-2.12 (or newer) here and install it via Terminal:

tar xzvf libapreq2-2.12.tar.gz
cd libapreq2-2.12
sudo make install

3. Build R

Go to your favorite CRAN-mirror (Georg-August Universität Göttingen) and download the source for R, e.g. R-2.11.1.tar.gz (section source code for all platforms). Now build R. Watch out for the configure option –enable-R-shlib!

tar xzvf R-2.11.1.tar.gz

cd R-2.11.1
./configure --enable-R-shlib
sudo make install

4. Install RApache

Download RApache from
Install RApache with the special configure option with-apache2-apxs!

tar xzvf rapache-1.1.9.tar.gz
cd rapache-1.1.9
./configure --with-apache2-apxs=/usr/sbin/apxs
sudo make
sudo make install

5. Reconfigure your Apache

Go to your Apache configuration file:

cd /private/etc/apache2/
sudo pico httpd.conf

(if you have TextMate installed, just use sudo mate httpd.conf)

now add the line after the other LoadModule entries in the httpd.conf file

LoadModule R_module           libexec/apache2/

Add the following line for debugging just below


as well as (put this somewhere at the end of the conf-file:

# Prints out a nice report about R running within Apache
<Location /RApacheInfo>
    SetHandler r-info

Save httpd.conf.
Restart Apache (open up Systempreferences, select Sharing and uncheck and check Websharing).
Now you should be able to go to

(you find the name of your computer in System preferences -> Sharing if you click on websharing: if websharing is running, it shows you a link to your computer – use the second link)

to get a nice info about RApache running on your system.

Have fun!

Update 8/11/2011
After that you have to reinstall R from CRAN again, because your regular R install will be broken. Hmmmm, I hope this gives all you RApache-Macheads enough headstart to come up with a cleaner solution.

To leave a comment for the author, please follow the link and comment on their blog: World of R-Craft. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)