简体   繁体   English

在Debian VM上安装闪亮的服务器

[英]Installing shiny server on Debian VM

I was trying to host shiny app on an offline Debian VM. 我试图在脱机Debian VM上托管闪亮的应用程序。 So, first, I install R-version 3.1.1 with apt-get on the VM: 因此,首先,我在VM上安装了带有apt-get的R-version 3.1.1:

$ sudo apt-get update
$ sudo apt-get install r-base
$ sudo apt-get install r-base-dev

Then, I scp all tar.gz files (Including all dependencies) of "shiny" package to the VM from my local and install them successfully with "R CMD ...". 然后,我从本地将“ shiny”包的所有tar.gz文件(包括所有依赖项)从本地scp到VM,并使用“ R CMD ...”成功安装它们。 After that, I ran the following command to install "gdebi" and used it to install "shiny-server-1.3.0.403-amd64.deb" for shiny server. 之后,我运行以下命令来安装“ gdebi”,并使用它为闪亮的服务器安装“ shiny-server-1.3.0.403-amd64.deb”。

$ sudo apt-get install gdebi-core
$ sudo gdebi shiny-server-1.3.0.403-amd64.deb

It returned error at the first time indicating the missing of dependencies: 第一次返回错误,表明缺少依赖项:

Reading package lists... Done
Building dependency tree        
Reading state information... Done
Building data structures... Done 
Building data structures... Done 
This package is uninstallable
Dependency is not satisfiable: libssl0.9.8

Then, I followed another post to add the following line to the "etc/apt/sources.list" file and then install the missing dependencies with "apt-get": 然后,我跟随另一篇文章,将以下行添加到“ etc / apt / sources.list”文件中,然后使用“ apt-get”安装缺少的依赖项:

 deb http://security.ubuntu.com/ubuntu lucid-security main

 $ sudo apt-get install libssl0.9.8
 Reading package lists... Done
 Building dependency tree       
 Reading state information... Done
 The following NEW packages will be installed:
 libssl0.9.8
 0 upgraded, 1 newly installed, 0 to remove and 26 not upgraded.
 Need to get 988 kB of archives.
 After this operation, 2,408 kB of additional disk space will be used.
 WARNING: The following packages cannot be authenticated!
 libssl0.9.8
 Install these packages without verification? [y/N] y
 Get:1 http://security.ubuntu.com/ubuntu/ lucid-security/main libssl0.9.8 amd64 0.9.8k-7ubuntu8.27 [988 kB]
 Fetched 988 kB in 1s (902 kB/s)      
 Preconfiguring packages ...
 Selecting previously unselected package libssl0.9.8.
 (Reading database ... 46468 files and directories currently installed.)
 Preparing to unpack .../libssl0.9.8_0.9.8k-7ubuntu8.27_amd64.deb ...
 Unpacking libssl0.9.8 (0.9.8k-7ubuntu8.27) ...
 Setting up libssl0.9.8 (0.9.8k-7ubuntu8.27) ...
 Processing triggers for libc-bin (2.19-18+deb8u3) ...

It seems worked and I installed "shiny-server-1.3.0.403-amd64.deb": 看来可行,我安装了“ shiny-server-1.3.0.403-amd64.deb”:

$ sudo gdebi shiny-server-1.3.0.403-amd64.deb
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Building data structures... Done 
Building data structures... Done 

Shiny Server
Shiny Server is a server program from RStudio, Inc. that makes Shiny applications available over the web. Shiny is a web application framework for the R statistical computation language.
Do you want to install the software package? [y/N]:y
Selecting previously unselected package shiny-server.
(Reading database ... 46487 files and directories currently installed.)
Preparing to unpack shiny-server-1.3.0.403-amd64.deb ...
Unpacking shiny-server (1.3.0.403) ...
Setting up shiny-server (1.3.0.403) ...
Creating user shiny
grep: /etc/init/shiny-server.conf: No such file or directory
Adding LANG to /etc/init.d/shiny-server, setting to en_US.UTF-8

Yet, when I tried to "stop/start" shiny server from terminal, cli can't recognize the command: 但是,当我尝试从终端“停止/启动”闪亮的服务器时,cli无法识别该命令:

$ sudo stop shiny-server
sudo: stop: command not found

I am wondering whether I installed the server right? 我想知道我是否正确安装了服务器? How can I "start/stop" shiny-server? 如何“启动/停止”闪亮服务器?

I've been using shiny-server this way on Debian Wheezy but switched to self-compiling when I upgraded to Debian Jessie, since this was the recommended route per RStudio Documentation. 我一直在Debian Wheezy上以这种方式使用Shiny-server,但是在升级到Debian Jessie时切换到自编译,因为这是RStudio文档中推荐的路由。

To answer your problem, shiny-server is managed using a init.d script. 为了回答您的问题,使用init.d脚本管理Shiny-server。 To start the server you should run /etc/init.d/shiny-server start or service shiny-server start as root (sudo). 要启动服务器,您应该以根用户身份(sudo)运行/etc/init.d/shiny-server startservice shiny-server start

This is not a Shiny problem, just you are missing the command , stop is an option for the command service 这不是一个闪亮的问题,只是您缺少命令,停止是命令服务的一个选项

You should use: 您应该使用:

sudo service start shiny-server

to start it 启动它

sudo service stop shiny-server

to stop it 阻止它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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