简体   繁体   中英

Launch shiny application on server

I am trying to launch shiny application on server. I just followed instruction from Administering guide:

mkdir ~/ShinyApps
sudo cp -R /opt/shiny-server/samples/sample-apps/hello ~/ShinyApps/

Then tried to access the hello application through http://<server-address>:3838/<your_username>/hello But it shows this page can't be displayed error. Anyone has any idea about what can cause this problem? Thanks!

Cont. Thanks Jeff, I used the exact same part in guide. Here is the shiny-server.conf file:

server {
  listen 3838;

  # Define a location at the base URL

  location /users {
      #this is set up so that I can run apps sithout sudo
      run_as :HOME_USER:
      user_dirs;
  }
  location /apps {
    run_as shiny;
    # 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;
  }
}

shiny-server.log shows lots of error:

[32m[2014-04-28 11:04:42.871] [INFO] shiny-server - [39mShiny Server v1.1.0.10000 (Node.js v0.10.21)
[32m[2014-04-28 11:04:42.875] [INFO] shiny-server - [39mUsing pidfile /var/run/shiny-server.pid
[32m[2014-04-28 11:04:42.877] [INFO] shiny-server - [39mUsing config file "/etc/shiny-server/shiny-server.conf"
[33m[2014-04-28 11:04:42.973] [WARN] shiny-server - [39mRunning as root unnecessarily is a security risk! You could be running more securely as non-root.
[31m[2014-04-28 11:04:42.217] [ERROR] shiny-server - [39mError loading config: location directive must contain (or inherit) one of site_dir, user_apps, app_dir, or redirect (/etc/shiny-server/shiny-server.conf:10:3)
[32m[2014-04-28 11:04:42.218] [INFO] shiny-server - [39mShutting down worker processes

How can I fix those those error?

I assume you got that command from this portion of the guide? If so, did you also use the deploy-example script to change your configuration file? Did you get any errors when you ran that script?

Alternatively, edit your question to include your configuration file at /etc/shiny-server/shiny-server.conf and we'll be able to see if your server is properly configured to use user_dirs which would be needed for users to be able to host their own applications.

Also check for (and/or edit your question to include) any recent entries in the server's log at /var/log/shiny-server.log .

Try the URL http://<server-address>:4949/sample-apps/ . If not 4949, try 3838.

The reason is whether the port 3838 is open. If it's not open, maybe you should run the following directives in your server:

iptables -I INPUT -p tcp --dport 3838 -j ACCEPT
iptables -I INPUT -p gre -j ACCEPT

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM