Extension:Shiny/CentOS 7

For installing the Shiny extension are three or four steps are necessary:


 * 1) Install a current R version
 * 2) Install the Shiny server
 * 3) Install the Shiny extension
 * 4) Optionally tweak the Apache configuration

For all steps it is assumed that a LAMP server and MediaWiki is installed and you are logged in as.

Additionally steps might be necessary if SELinux is activated, see in  if is set. To avoid these steps you could deactivate SELinux by setting  and reboot.

R
R is not part of the standard repositories in CentOS 7, but part of the Extra Packages for Enterprise Linux (EPEL). How to add the EPEL repository to your CentOS 7 installation, see in the EPEL FAQ: How can I install the packages from the EPEL software repository?. Then run

yum install R

After that R should have been installed.

Shiny server
R -e "install.packages('shiny', repos='https://cran.rstudio.com/')" wget https://download3.rstudio.org/centos5.9/x86_64/shiny-server-1.4.2.786-rh5-x86_64.rpm yum install --nogpgcheck shiny-server-1.4.2.786-rh5-x86_64.rpm cd /srv/shiny-server mkdir mediawiki chown apache:apache mediawiki
 * Install the  package in R
 * Download the Shiny server (check if the version  still is okay)
 * Install the Shiny server to your system
 * To check if the shiny server works enter in your browser:
 * Add a path and permissions to store the shiny apps

MediaWiki
yum install php-xml systemctl restart httpd.service cd /extensions yum install git git clone https://github.com/sigbertklinke/Shiny wfLoadExtension( 'Shiny' );
 * Hint: For the correct installation of the MediaWiki you need to install  in CentOS 7 and to restart the Apache web server
 * After the installation of your wiki go to the  directory
 * If necessary then install
 * Clone the Shiny extension from
 * Edit your  and add at the end

Apache
The Apache webserver listens to port 80 and the Shiny server to port 3838. Usually I modify the Apache configuration file such that any URL with starts with  is redirected to the Shiny server:

cd /etc/httpd/conf.d     ProxyRequests Off  Require local  ProxyPass       /shiny/ http://localhost:3838/ ProxyPassReverse /shiny/ http://localhost:3838/  /usr/sbin/setsebool -P httpd_can_network_connect 1 systemctl restart httpd.service
 * Go to the Apache configuration directory
 * Create a configuration file  with
 * If SELinux is active then you need to allow then Apache web server to make outbound connections with
 * Restart the apache server
 * To check if this works properly enter in your browser:  (and when you enter   you should see the same page)