I am trying to setup R Shiny Server on my Amazon Linux AWS EC2 instance and am getting the following error:
An error has occurred
The application failed to start.
The application exited during initialization.
I did a sudo shiny-server to see what happens and see the error EADDRINUSE:
$ sudo shiny-server
[2017-01-29 13:21:22.724] [INFO] shiny-server - Shiny Server v1.5.1.834 (Node.js v6.9.1)
[2017-01-29 13:21:22.728] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2017-01-29 13:21:22.764] [INFO] shiny-server - Starting listener on 0.0.0.0:80
[2017-01-29 13:21:22.771] [ERROR] shiny-server - HTTP server error (0.0.0.0:80): listen EADDRINUSE 0.0.0.0:80
[2017-01-29 13:21:22.771] [INFO] shiny-server - Shutting down worker processes
I have verified that Shiny, rmarkdown and, Shiny Server and R are properly installed on my instance:
R --version
R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.
> library(shiny)
> library(rmarkdown)
>
I have also checked the network connection on my ec2 instance:
$ sudo netstat --tcp -nlpa | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1875/shiny-server
My ec2 instance network security group:
$ aws ec2 describe-security-groups --group-name launch-wizard-7
{
"SecurityGroups": [
{
"IpPermissionsEgress": [
{
"IpProtocol": "-1",
"PrefixListIds": [],
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"UserIdGroupPairs": [],
"Ipv6Ranges": []
}
],
"Description": "launch-wizard-7 created 2017-01-28T14:22:51.817-05:00",
"IpPermissions": [
{
"PrefixListIds": [],
"FromPort": 80,
"IpRanges": [
{
"CidrIp": "0.0.0.0/0"
}
],
"ToPort": 80,
"IpProtocol": "tcp",
"UserIdGroupPairs": [],
"Ipv6Ranges": []
},
(there's another entry but that ssh into my own machine so I won't put that information)
and here is my shiny-server.conf file from /etc/shiny-server/shiny-server.conf
$ cat /etc/shiny-server/shiny-server.conf
# Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
# Define a server that listens on port 3838
server {
listen 3838;
# Define a location at the base URL
location / {
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;
# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
}
}
Any help would be really appreciated. I tried to let AWS listen to request for port 80 for all ip addresses and for the shiny-server as I thought maybe both services shouldn't be listening to the same port but that didn't work. Am just trying to deploy the sample-app that came with shiny server.