opencpu cloud server installation guide on ubuntu 16.04 - r

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

Related

How to upgrade R version on AWS EC2 instance?

Quite surprisingly it's hard to find a workable solution around this.
I have an EC2 instance launched with Ubuntu 18.04 distribution.
I do sudo-get install r-base but the installed R version is R3.4
I've followed the steps here below where it asks to edit the source.list file
https://cran.r-project.org/bin/linux/ubuntu/README.html#installation
However, AWS declines the update as the source link is not secured.
Have you made sure you succesfully added the public key to the system?
This has worked for me fine in EC2 Ubuntu 18.04 to update to R 3.6.1. I also followed instructions given in https://cran.r-project.org/bin/linux/ubuntu/README.html#installation.
First, add the public key in the documentation´s "Secure APT" section. Run this in terminal:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Next, add modify your file /etc/apt/source.list by entering this command:
$ sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
Once that is done, enter this command and double check if AWS has not declined the update
$ sudo apt update
Finally, run this to get updates installed
$ sudo apt install r-base r-base-dev
I found this resource to be very helpful:
https://www.charlesbordet.com/en/shiny-aws-3/#how-to-install-shiny-server
I ended up using AMI from this website
louisaslett.com/RStudio_AMI/
It has some pre-builts libraries and installations.

Can't Get RStudio Server to Run on EC2

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.

Why does the system hint 'invalid syntax', when I am executing 'pip install shadowsocks' on centos6

When I am executing pip install shadowsocks on my vps for install the shadowsocks, it tells me invalid syntax. I prepare to install shadowsocks on my vps this morning, I am running yum update -y and yum install python-setuptools && easy_install pip in turns.
After that I am executing pip install shadowsocks and got a hint invalid syntax. I am reading the hint seriously, but I can't read it very well.
I do not understand what the hint want to tell me.
what is you do something like this
sudo apt-get update && sudo apt-get install python-pip

NginX still running when uninstalled it

I have tried to uninstall NGinX from my Ubuntu using following command:
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras nginx-common
I have used below command as well
sudo apt-get remove --purge nginx*
And still see below screen when I check NginX processes running.
What is happening??
Try to run sudo killall nginx.
Try to clear the web browser cache. It works for me.

Nginx update on ubuntu fails

I am not nginx expert and having problems in configuring it.
Examples I found on web are slightly different so I wanted to update nginx 1.05 to 1.4.1 to see if it helps.
I have found instructions to install nginx from PPA as
apt-get install python-software-properties
add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx
It seems as is it has installed but nginx -v is still telling me I have 1.0.5
What I missed?
Using ubuntu 11.10
Thanks
NGINX maintains is own apt repository which means you don't need to use the PPA.
Firstly remove the added ppa:
sudo add-apt-repository --remove ppa:nginx/stable
Then, if you're not running anything critical through nginx I would suggest running apt-get remove --purge nginx to completely remove nginx.
To use NGINX's repository add the following to `/etc/apt/sources.list.d/nginx.list':
deb http://nginx.org/packages/ubuntu/ oneiric nginx
deb-src http://nginx.org/packages/ubuntu/ oneiric nginx
Then run apt-get update. Then reinstall using apt-get install nginx.
Hope that works.

Resources