I followed these commands to install R and Shiny server on REHL 7 AWS.
sudo yum update
yum install wget gcc pcre-devel libXt-devel cairo-devel pango-devel
pango libpng-devel curl-devel unixODBC-devel python-devel java-1.8.0-
openjdk-devel xz-devel
yum groupinstall "Development tools"
wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar xzvf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
make -f Makefile-libbz2_so
make clean
make
make -n install
make install
cd ~
wget https://cran.r-project.org/src/base/R-3/R-3.3.2.tar.gz
tar -xzvf R-3.3.2.tar.gz
cd R-3.3.2
./configure --with-readline=no --with-x=no
make
make install
cp -r /usr/local/bin/R /usr/local/sbin/R
cp -r /usr/local/bin/Rscript /usr/local/sbin/Rscript
--Installing R packages
R
install.packages(c('shiny', 'rmarkdown', 'Cairo', 'png', 'rJava',
'RCurl'))
--Changing folder permissions
chmod 777 -R /usr/local/bin
chmod 777 -R /usr/local/sbin
chmod 777 -R /usr/local/lib64/R
chmod 777 -R /usr/local/lib64/R/library
chmod 777 /usr/local/lib64/R/etc/ldpaths
--shiny server installation
wget https://download3.rstudio.org/centos5.9/x86_64/shiny-server-
1.5.1.834-rh5-x86_64.rpm
sudo yum install --nogpgcheck shiny-server-1.5.1.834-rh5-x86_64.rpm
R CMD javareconf
chmod 777 /usr/local/lib64/R/etc/ldpaths
Everything ran fine with some warnings. But the shiny-server.service file is missing. When I try to execute
systemctl restart shiny-server
it says: Failed to restart shiny-server.service: Unit not found.
I also tried installing the newer version of R (3.4.1) and Shiny server(shiny-server-1.5.3.838-rh5-x86_64.rpm) but I am still getting the same error. This is the message I got when I installed shiny server:
/var/tmp/rpm-tmp.kIBODd: line 62: initctl: command not found
/var/tmp/rpm-tmp.kIBODd: line 65: initctl: command not found
Verifying : shiny-server-1.5.1.834-1.x86_64
1/1
Installed:
shiny-server.x86_64 0:1.5.1.834-1
Also I noticed that shiny-server.service is missing in /etc/systemd/system folder. Has anyone resolved this or knows how to resolve this?
I had the same problem.
As suggested in https://github.com/rstudio/shiny-server/issues/316,
entering these three lines manually solved it for me:
sudo cp /opt/shiny-server/config/systemd/shiny-server.service /etc/systemd/system/
sudo systemctl enable shiny-server
sudo systemctl restart shiny-server
Related
I installed shinyproxy using docker-compose.
When going to my shiny app, I am running into the error:
Status code: 500
Message: Failed to start container
and when checking into error message I see:
starting container process caused \"exec: \\"R\\": executable file not found in $PATH\": unknown"}
I am not sure to understand what it means.
In case that helps, the last lines of my Shiny Dockerfile are:
EXPOSE 3838
CMD ["R", "-e", "shiny::runApp('/root/app')"]
and in my application.yml the container-cmd line is
container-cmd: ["R", "-e", "shiny::runApp('/root/app')"]
Do you see any wrong spelling?
Also as an FYI but don't know if that's useful information, I noticed that:
- There is no R folder in my folder: /usr/lib
- And there is no R folder in /usr/bin/.
And I don't understand why.
Thanks for your help !
EDIT1:
I just installed R and now I see R in the /usr/bin/ folder but still nothing in /usr/lib and still same error message.
EDIT2:
I don't understand one thing, I see the R packages being installed in /usr/local/lib/R BUT
I see nothing in this folder after docker-compose up is done:
$ cd /usr/local/lib
$ ls
$
EDIT3:
As requested, I attach below the Dockerfile for my RStudio container and the Dockerfile for Shiny container:
RStudio Dockerfile:
FROM rocker/tidyverse:3.6.1
## Create directories
RUN mkdir -p /rstudio
RUN mkdir -p /rscripts
RUN R -e "install.packages(c('rvest','shiny','DT', 'digest', 'RCurl', 'caTools', 'bitops', 'httr', 'curl', 'stringr', 'mailR', 'xlsx', 'knitr', 'kableExtra' ,'rmarkdown', 'data.table', 'RSelenium'), repos = 'http://cran.us.r-project.org')"
Shiny Dockerfile:
FROM rocker/shiny:3.5.1
RUN apt-get update && apt-get install libcurl4-openssl-dev libv8-3.14-dev -y &&\
mkdir -p /var/lib/shiny-server/bookmarks/shiny &&\
mkdir -p /root/app
# Download and install library
RUN R -e "install.packages(c('mailR', 'shinydashboard', 'shinyjs', 'V8', 'DT', 'shiny', 'rvest', 'dplyr', 'htmltools', 'promises', 'jsonlite', 'data.table', 'rlang', 'xml2', 'digest', 'XML','rmarkdown'))"
# copy the app to the image
COPY app /root/app
COPY Rprofile.site /usr/local/lib/R/etc
# make all app files readable (solves issue when dev in Windows, but building in Ubuntu)
RUN chmod -R 755 /root/app
RUN chmod -R 755 /usr/local/lib/R/etc
EXPOSE 3838
CMD ["R", "-e", "shiny::runApp('/root/app')"]
I followed the instruction here to install mariadb on WSL after following the steps. and I run this
sudo service mysql start
I got
mysql: unrecognized service
Any idea how to solve this?
It's just a simple problem as you see but it takes me 24 hours to diagnose the problem.
Solution:
I uninstall mariadb with this command
sudo apt-get remove --auto-remove mariadb-server
and install sudo apt install mysql-server instead but it leads to a more problems
Successfully install mysql but can't start
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
so by removing mariadb's deb sources and purging mysql-common and then reinstalling it.
do:
sudo apt edit-sources
and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main
comment it out by putting a # in front of it. then run
sudo apt update
sudo apt purge mysql-common
sudo apt install mysql-common
after that you can installed mysql-server properly via sudo apt install mysql-server, then do:
sudo apt purge mysql-server mysql-server-5.7
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rfv /etc/mysql /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
Finally:
sudo apt update
sudo apt install mysql-server mysql-client --fix-broken --fix-missing
References:
https://askubuntu.com/questions/980314/cannot-install-mysql-server-in-ubuntu16-0-4
https://askubuntu.com/questions/763534/cannot-reinstall-mysql-server-after-its-purge
Which Linux distribution are you using on your WSL?
First, try the following:
systemctl {start|stop|restart|status} mysql
OR
service mysql {start|stop|restart|status}
to manage the MySQL service.
The reasons can be the following:
Wrong service name:
On some Linux distributions, the service is named as mysqld instead of mysql.
To check: Run chkconfig --list on your WSL and identify the correct service name.
File permission issues:
Please ensure that the files in /var/lib/mysql have 770 permissions and ownership set to mysql user.
To fix:
chmod -R 770 /var/lib/mysql
chgrp -R mysql /var/lib/mysql
In addition to that, ensure that the /etc/rc.d/init.d/mysqld script has executable permissions to modify mysqld.
To fix:
chmod 755 /etc/rc.d/init.d/mysqld
Missing/Corrupted MySQL server package:
Reinstall MySQL!
I converted to Ubuntu today, but have a problems launching R studio. I installed R through the command prompt like this:
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/">> /etc/apt/sources.list'
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install r-base
I cheked if R was installed proper by typing R and then exiting by q(save="no").
I installed R studio through the command prompt by
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/rstudio-server-0.99.902-amd64.deb
sudo gdebi rstudio-server-0.99.902-amd64.deb
But this doesn't work and i can't find the launch button or open R studio.
Afterwards i tried to remove it and install it through the website but doesn't work either. What should i do?
There is no lauch button -- you connect to port 8787 on the machine running RStudio Server.
In other words, type http://localhost:8787 in the address bar of your browser. You should see a login screen with the RStudio logo. This connects you to your RStudio Server.
If you want to run the Desktop version you need to install the other available .deb package.
For those on Ubuntu 16.10, or who prefer to use the desktop version of RStudio, you may wish to follow the solution posted by Mike Williamson reproduced below:
1) Get the latest R Studio Daily Build here, though note that it's not necessarily stable.
2) Install, chaning the name of the package to the one you downloaded - perhaps easiest if you go to your Downloads directory - and you'll probably find that there are missing packages:
$ sudo dpkg -i rstudio-1.0.124-amd64.deb
3) Download the missing packages (the lack of which causes the installation to fail):
$ wget http://ftp.ca.debian.org/debian/pool/main/g/gstreamer0.10/libgstreamer0.10-0_0.10.36-1.5_amd64.deb
$ wget http://ftp.ca.debian.org/debian/pool/main/g/gst-plugins-base0.10/libgstreamer-plugins-base0.10-0_0.10.36-2_amd64.deb
4) Install them:
$ sudo dpkg -i libgstreamer0.10-0_0.10.36-1.5_amd64.deb
$ sudo dpkg -i libgstreamer-plugins-base0.10-0_0.10.36-2_amd64.deb
5) Make sure they don't get over-written at the next software update:
$ sudo apt-mark hold libgstreamer-plugins-base0.10-0
$ sudo apt-mark hold libgstreamer0.10
6) Install RStudio (changing name to the version you downloaded):
sudo gdebi rstudio-1.1.5-amd64.deb
7) Launch RStudio:
rstudio
In Plesk panel I get the log error : wget command not found. But there is already wget command installed.
How could I solve this issue ?
cron command: wget -q -O – http://www.example.com/wp-cron.php?doing_wp_cron
This should simple and straight forward. what you need to do is install
On Ubuntu: sudo apt-get install wget
or on Fedora/Redhat/Centos: sudo yum install wget
make sure you have rights to run apt-get install or yum install. After you install wget that error in Plesk should go away. By the way, instead of wget -q -O you can also use cURL as an alternate solution to call your cron script.
Set up using AWS instance running centOS 6.4 with R and shiny server using my Macbook and trying to figure out what is wrong with it as there are issues with this process
# set up AWS Redhat 6.4 instance (dont forget to download .pem)
# set the .pem file into your ~/.ssh/ folder and make sure you chmod the file
chmod 400 ~/.ssh/myshinypemexample.pem
ssh into machine
ssh -i ~/.ssh/myshinypemexample.pem root#yourPublicDNS
# the first time you run this, just press yes, don't be scared :)
# use ec2-user and log into machine
ssh -i ~/.ssh/myshinypemexample.pem ec2-user#yourPublicDNS
Get the EPEL rpm
wget http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm --test
Import the EPEL GPG key
wget https://www.fedoraproject.org/static/0608B895.txt
sudo mv 0608B895.txt /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Verify that the key has been imported.
rpm -qa gpg*
## You should see a line like this: gpg-pubkey-0608b895-4bd22942
Install the rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
Install shiny server
sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
# this gives error and have to install Rcpp and httr manually
wget http://cran.r-project.org/src/contrib/Rcpp_0.11.1.tar.gz
sudo R CMD INSTALL --build Rcpp_0.11.1.tar.gz
wget http://cran.r-project.org/src/contrib/httpuv_1.2.3.tar.gz
sudo R CMD INSTALL --build httpuv_1.2.3.tar.gz
run shiny server again
sudo su - -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
Install Shiny Server
wget http://download3.rstudio.org/centos-5.9/x86_64/shiny-server-1.0.0.42-x86_64.rpm
sudo yum install --nogpgcheck shiny-server-1.0.0.42-x86_64.rpm
# test server
sudo status shiny-server
check location of example shiny app
sudo R -e "system.file('examples/01_hello', package='shiny')"
[1] "/usr/lib64/R/library/shiny/examples/01_hello"
#copy example file from R to /srv as Shiny looks for this location to work
sudo cp -R /usr/lib64/R/library/shiny/examples/01_hello /srv/shiny-server/
MYIP:3838 does not resolve. Why?