I need to create an AMI with a clean install of R and RStudio Server. I have tried this on Amazon Linux 2 AMI (HVM), Amazon Linux AMI 2018.03.0 (HVM), and Ubuntu Server 18.04 LTS (HVM) but none of them work. I do not get any errors (that I notice) in my installs but when I try to access RStudio Server via http://ec2-XX-XX-XX-XX.compute-1.amazonaws.com:8787 there's nothing to connect to. I have even tried opening all ports to all IPs to make sure it wasn't a networking issue.
My Amazon API install scripts are below
Amazon Linux AMI 2018.03.0 (HVM)
sudo yum install -y R
wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.2.1335-x86_64.rpm
sudo yum install -y rstudio-server-rhel-1.2.1335-x86_64.rpm
rm rstudio-server-rhel-1.2.1335-x86_64.rpm
Amazon Linux 2 AMI
sudo amazon-linux-extras install -y R3.4
wget https://download2.rstudio.org/server/centos6/x86_64/rstudio-server-rhel-1.2.1335-x86_64.rpm
sudo yum install -y rstudio-server-rhel-1.2.1335-x86_64.rpm
rm rstudio-server-rhel-1.2.1335-x86_64.rpm
I get this as part of the result:
Running transaction
Installing : rstudio-server-1.0.153-1.x86_64 1/1
groupadd: group 'rstudio-server' already exists
rsession: no process found
rstudio-server start/running, process 4990
Verifying : rstudio-server-1.0.153-1.x86_64 1/1
Installed:
rstudio-server.x86_64 0:1.0.153-1
Complete!
I think the issue is the rsession: no process found portion but I can't figure out how to resolve it.
Related
I managed to create an EC2 instance Amazon Linux AMI 2017.09.1 (randomly chosen) on Amazon Web Services (AWS).
I can send and receive files from my local desktop to AWS properly.
Now I would like to install R (RStudio Server) on AWS.
When searching for an answer, I found the script below that is to be written into Putty:
# install R base
$ sudo yum install r-base
#install RStudio-Server 1.1.442
$ sudo yum install gdebi-core
$ wget https://download2.rstudio.org/rstudio-server-1.1.442-amd64.deb
$ sudo gdebi rstudio-server-1.1.442-amd64.deb
#add user(s)
useradd username
echo username:password | passwordtest
But the answer I get each time is: "No package r-base available" or also "No package gdebi-core available".
Are they some prerequisite steps that I am missing?
Thanks.
M
Amazon Linux AMI 2017.09.1 is based on Centos 6 and the step you got is for Ubuntu(gdebi is an Ubuntu installer), Here are the steps from the official documentation.
$ sudo yum install R
$ wget https://download2.rstudio.org/rstudio-server-rhel-1.1.442-x86_64.rpm
$ sudo yum install rstudio-server-rhel-1.1.442-x86_64.rpm
How to install PHP 7.1 on Amazon EC2 t2.micro Instance running Amazon Linux AMI 2018.03 having nginx as web server?
Reference to PHP7
With reference to this answer, change Step 1 to the following:
1. Install Apache 2.4 and PHP 7.1 on Amazon Linux AMI
# Remove current apache & php
sudo yum remove httpd* php*
# Install Apache 2.4
sudo yum install httpd24
# Install PHP 7.1
sudo yum install php71
# Install additional commonly used php packages
sudo yum install php71-gd
sudo yum install php71-imap
sudo yum install php71-mbstring
sudo yum install php71-mysqlnd
sudo yum install php71-opcache
sudo yum install php71-pdo
sudo yum install php71-pecl-apcu
Basically replacing php70 with php71.
Continue with step 2 and the rest as per the original tutorial.
I followed below steps to install PHP7.1 which had already Nginx as web server for Amazon Linux AMI 2018.03
#Remove Old PHP
yum remove php*
#Update Reposistory
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
#Update Amazon AMI
yum upgrade -y
#Install PHP
#List of PHP packages https://webtatic.com/packages/php71/
yum install php71w php71w-cli php71w-fpm
yum install php71w-mysql php71w-xml php71w-curl
yum install php71w-opcache php71w-pdo php71w-gd
yum install php71w-pecl-apcu php71w-mbstring php71w-imap
yum install php71w-pecl-redis php71w-mcrypt
#change listen mode to CGI
sed -i 's/127.0.0.1:9000/\/tmp\/php5-fpm.sock/g' /etc/php-fpm.d/www.conf
/etc/init.d/php-fpm restart
touch /tmp/php5-fpm.sock
chmod 777 /tmp/php5-fpm.sock
service nginx restart
The reason I am still using /tmp/php5-fpm.sock file so that I do not need to change PHP7 sock file in all website nginx conf and assuming server do not have PHP5 as as on first step it has been removed.
A reliable way to achieve the same output is by following commands on Amazon Linux AMI 2.
# Remove current php & apache
sudo service httpd stop
sudo yum remove httpd* php*
sudo yum install httpd
amazon-linux-extras install php7.1
Would anyone know or like to share their note on installing opencpu cloud server on ubuntu 16.04?
I thought it is easy, but we saw many error here and there when following the instructions. I am new to opencpu. And, I don't have much experience on apache and nignx.
Here is the long story:
I created a new and clean ubuntu 16.04 server from microsoft azure vm, and installed opencpu cloud server following:
# Requires Ubuntu 14.04 (Trusty) or 16.04 (Xenial)
sudo add-apt-repository -y ppa:opencpu/opencpu-1.6
sudo apt-get update
sudo apt-get upgrade
# Installs OpenCPU server
sudo apt-get install -y opencpu
The server reported insserv error when running opencpu init script
update-rc.d: error: insserv rejected the script header dpkg
We then did some goolge and fix around, we got apache2 running, but when called:
curl http://localhost/ocpu/info
received 404 error.
FYI, the single user server runs fine.
The solution we found is that opencpu need mod_R to be turned on from apache2:
sudo a2enmod R
You need first to change to dir:
/etc/apache2/mods-available
And, make sure R.load file exists.
After running a2enmod command, should see a link to R.load (R module) in
/etc/apache2/mods-enable
Thank you y g for your question and response .. I had the same problem i try what you have mentioned in your comment but
curl http://localhost/cpu/info
takes along time without no response.
Thank you.
I used opencpu 1.5 works without bugs on ubuntu 16.04
sudo add-apt-repository -y ppa:opencpu/opencpu-1.5
sudo apt-get update
sudo apt-get upgrade
Install R and then install opencpu
sudo apt-get install r-base r-base-dev
sudo apt-get install -y opencpu
Also you should probably install Rstudio for IDE access
sudo apt-get install rstudio-server
To login to R you'll need to make a new user - follow the prompts
sudo adduser myname
Now just to make sure its all working
sudo service opencpu restart
sudo service rstudio-server restart
And try something like to check if its working
curl -L -v localhost/ocpu/library/
which should return a list of packages now installed on Ubuntu like this
Final Screenshot
I have a an Amazon Linux instance which uses R to write a function to do some data analysis. I now want to call this function using a REST API. It seems that OpenCPU can get the job done for me.
I have found links to install OpenCPU on Ubuntu, but is there an easy to way to install it on Amazon Linux instance.
PS: I tried
sudo yum -y install opencpu
sudo yum -y install opencpu-server
It says no such package available.
I managed to get it installed from this script https://github.com/jeroenooms/opencpu-server/blob/master/rpm/buildscript.sh.
We now have rpm packages for CentOS 6 and 7 at https://archive.opencpu.org/
I need help on installing saltstack on RHEL 7.
RHEL 7 server is from AWS Amazon.
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.0 (Maipo)
I'm getting an error during installation:
$ wget -O - http://bootstrap.saltstack.org | sudo sh
2014-08-04 09:41:45 (932 KB/s) - written to stdout [177548/177548]
INFO: Found function install_red_hat_enterprise_linux_7_stable_deps
INFO: Found function install_red_hat_enterprise_linux_stable
INFO: Found function install_red_hat_enterprise_linux_stable_post
INFO: Found function install_red_hat_enterprise_linux_restart_daemons
INFO: Found function daemons_running
INFO: Running install_red_hat_enterprise_linux_7_stable_deps()
ERROR: Stable version is not available on RHEL 7 Beta/RC. Please set installation type to git.
ERROR: Failed to run install_red_hat_enterprise_linux_7_stable_deps()!!!
Is this version of RHEL 7 not supported for saltstack?
Run the following commands to install from the latest develop branch:
curl -o install_salt.sh -L https://bootstrap.saltstack.com
sudo sh install_salt.sh -M git develop
Remove the -M from the command above if you don't want to install a salt-master and only want to install salt-minion.
I have a similar problem, I tried to install it from epel 7 beta, but there's another problem, see https://bugzilla.redhat.com/show_bug.cgi?id=1127348. Finally I was able to install it by combining pip and yum. I don't have the exact sequence of commands, but sth. like this should work:
yum install --skip-broken salt python-pip
pip install jinja2
I have tried installing SaltStack on CentOS 7 , which should be similar to Redhat 7, and you could try it, hope it works for you:
**[updated]** http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
and then you could
yum install -y salt-master
or
yum install -y install salt-minion
to install it.
You need to enable the rhel-7-server-optional-rpms repo in subscription-manager.