Unable to load shiny apps hosted on an Amazon EC2 instance using Shiny Server

Hi all! I am attempting to host a Shiny app via an Amazon EC2 instance using Shiny Server. I am following this guide. I should note that this has worked for me in the past.

However, I am now getting an error where I am unable to load the app after following the instructions. I have followed all the instructions to the best of my ability.

  1. I have installed the Shiny Server, and have confirmed that it is running.

  2. I have checked the shiny-server.conf file and it is indeed listening on port 3838.

  3. I have updated the instance security rules to allow the 3838 port

  4. I have confirmed that I have a folder called "myapp" with a basic app file (I am testing with this sample app first)

  5. Finally, I have navigated to the IP address using the :3838/myapp suffix (this is what has worked in the past), but I get an error:

The log folder for the shiny-server is empty, which leads me to believe its never being spun up/initialized in the first place when I try to open it.

Anyone have any insight into what's happening here? I am very inexperienced with server hosting and the like, so any hints would be greatly appreciated. Thanks in advance!

For posterity, I have solved this issue. First I restarted the shiny-server:

systemctl restart shiny-server

Then I updated the conf file as such:

# Instruct Shiny Server to run applications as the user "shiny"
run_as ubuntu;

# Define a server that listens on port 3838
server {
  listen 3838;

    location /users {
      run_as :HOME_USER:;
      user_dirs;
    }

    # Define a location at the base URL
    location /allappfolders {
        run_as shiny;

        # Host the directory of Shiny Apps stored in this directory
        site_dir /opt/shiny-server/allappfolders;

        # Log all Shiny output to files in this directory
        log_dir /var/log/shiny-server/allappfolders;

        # 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;
    };

    # Define a location at the base URL
    location /app1 {

        # Host the directory of Shiny Apps stored in this directory
        app_dir /opt/shiny-server/allappfolders/app1;

        # Log all Shiny output to files in this directory
        log_dir /var/log/shiny-server/app1;

        # 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 off;
    };

    # Define a location at the base URL
    location /app2 {

        # Host the directory of Shiny Apps stored in this directory
        app_dir /opt/shiny-server/allappfolders/app2;

        # Log all Shiny output to files in this directory
        log_dir /var/log/shiny-server/app2;

        # 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 off;
    };

}

This also involved moving my app files to /opt/ directory.

To be quite honest, I'm not sure what was the fix..... but it worked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.