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 root.

Additionally steps might be necessary if SELinux is activated, see in /etc/selinux/config if is set SELINUX=enforcing. To avoid these steps you could deactivate SELinux by setting SELINUX=disabled 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 shiny package in R
 * Download the Shiny server (check if the version 1.4.2.786 still is okay)
 * Install the Shiny server to your system
 * To check if the shiny server works enter in your browser: http://:3838
 * 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 php-xml</tt> in CentOS 7 and to restart the Apache web server
 * After the installation of your wiki go to the extensions</tt> directory
 * If necessary then install git</tt>
 * Clone the Shiny extension from github.com</tt>
 * Edit your <my.wiki>/LocalSettings.php</tt> 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 http://<my.domain>/shiny/</tt> is redirected to the Shiny server:

cd /etc/httpd/conf.d <IfModule mod_proxy.c>    ProxyRequests Off <Proxy /shiny/> Require local </Proxy> ProxyPass       /shiny/ http://localhost:3838/ ProxyPassReverse /shiny/ http://localhost:3838/ </IfModule> /usr/sbin/setsebool -P httpd_can_network_connect 1 systemctl restart httpd.service
 * Go to the Apache configuration directory
 * Create a configuration file reverse-proxy.conf</tt> 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: http://<my.domain>/shiny/</tt> (and when you enter http://<my.domain>:3838/</tt> you should see the same page)