I'm running Shiny Server on an AWS EC2 (Ubuntu 16.4), and trying to configure an Apache2 server reverse proxy to serve port 3838 to the website's /apps sub-folder. I've opened port 3838 in the AWS security group, as well as ufw on the EC2. When I call the IP directly (http://x.x.x.x:3838/) it works fine, as when I call the EC2's default public DNS - http://ec2-x-x-x-x.region.compute.amazonaws.com:3838/.
But I've also set up a domain mydomain with a DNS provider and set to web forward from mydomain to the IP. When I call the root I get the correct apache page. When I call /apps/ the Welcome to Shiny Server! page comes through but the embedded demo shiny apps crash. Checking the log directory reveals:
-rw-r----- 1 shiny shiny 37 Apr 10 12:58 hello-shiny-20180410-125811-42266.log
-rw-r----- 1 shiny shiny 37 Apr 10 12:58 rmd-shiny-20180410-125811-42875.log
Weirdly, these disappear on their own after a moment. But reading as su reveals:
root@ip-x.x.x.x:/var/log/shiny-server# cat hello-shiny-20180410-125924-38902.log
Listening on http://127.0.0.1:38902
[N.B. I previously said this was Permission denied but I realised that was the response to the cat call!]
Can anyone please help to identify why this is failing. I've spent hours trawling questions around this and nothing works.
My /etc/apache2/sites-available/000-default.conf file <VirtualHost *:80> clause contains:
ProxyPass /apps/ http://0.0.0.0:3838/
ProxyPassReverse /apps/ http://0.0.0.0:3838/
/etc/shiny-server/shiny-server.conf looks like:
# 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;
}
}