Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2293426
  • 博文数量: 276
  • 博客积分: 5998
  • 博客等级: 大校
  • 技术积分: 5175
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-24 14:43
文章分类

全部博文(276)

文章存档

2014年(25)

2013年(11)

2012年(69)

2011年(167)

2010年(4)

分类: 大数据

2014-04-03 14:12:58

shiny server是一种可用把R 语言以web形式展示的服务
环境:centos 6.3 64bit

1、安装R 环境
    http://blog.chinaunix.net/uid-25135004-id-4173752.html
2、安装shiny (两种方法)
    1)方法一网络安装
        1>R 进入命令行
        2>install.packages('shiny')
    2)方法二下载相关包,安装
        1>下载一下包
            
            
            
            
            
            
            
            
    2>安装
             R CMD INSTALL Rcpp_0.11.1.tar.gz
             R CMD INSTALL bitops_1.0-6.tar.gz 
             R CMD INSTALL httpuv_1.2.3.tar.gz 
             R CMD INSTALL caTools_1.16.tar.gz 
             R CMD INSTALL RJSONIO_1.0-3.tar.gz
             R CMD INSTALL xtable_1.7-3.tar.gz 
             R CMD INSTALL digest_0.6.4.tar.gz 
             R CMD INSTALL shiny_0.9.1.tar.gz 

3、验证shinay包是否成功安装(进入R 命令行)
    > library("shiny") 无报错

4、下载shiny-server

    

5、安装shiny-server
    yum install --nogpgcheck shiny-server-1.0.0.42-x86_64.rpm

6、shiny-server 配置
    相关网址:
    1) 配置文件路径
        /opt/shiny-server/config/default.config
    2)配置内容

点击(此处)折叠或打开

  1. # Instruct Shiny Server to run applications as the user "shiny"
  2. run_as shiny;
  3. # Define a server that listens on port 3838
  4. server {
  5. listen 8080;
  6. # Define a location at the base URL
  7. location / {
  8. # Host the directory of Shiny Apps stored in this directory
  9. site_dir /export/shiny-server/data;
  10. # Log all Shiny output to files in this directory
  11. log_dir /var/log/shiny-server;
  12. # When a user visits the base URL rather than a particular application,
  13. # an index of the applications available in this directory will be shown.
  14. directory_index on;
  15. }
  16. }

7、shiny-server 管理
    相关网址:
    1)启动,关闭,重启,查看状态命令
        start shiny-server
        stop shiny-server
        restart shiny-server
        status shiny-server

     
2)不中断服务加载配置
           reload shiny-server
8、访问界面 用google浏览器访问 (我们修改端口为8080)




阅读(12757) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~