{"id":3938,"date":"2024-10-20T11:01:43","date_gmt":"2024-10-20T03:01:43","guid":{"rendered":"http:\/\/www.chenlianfu.com\/?p=3938"},"modified":"2024-11-13T22:07:46","modified_gmt":"2024-11-13T14:07:46","slug":"%e5%ae%89%e8%a3%85%e5%b9%b6%e4%bd%bf%e7%94%a8rstudio-server","status":"publish","type":"post","link":"http:\/\/www.chenlianfu.com\/?p=3938","title":{"rendered":"\u5b89\u88c5\u5e76\u4f7f\u7528RStudio Server"},"content":{"rendered":"\n<p>\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5RStudio Server\u7248\u672c\u540e\uff0c\u5373\u53ef\u8fdc\u7a0b\u8bbf\u95ee\u5e76\u4f7f\u7528\u670d\u52a1\u5668\u7684R\u8f6f\u4ef6\u3002RStudio Server\u7684\u5b89\u88c5\u53ef\u4ee5\u53c2\u8003\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/posit.co\/download\/rstudio-server\/\" target=\"_blank\">https:\/\/posit.co\/download\/rstudio-server\/<\/a>\u3002<\/p>\n\n\n\n<h2>1. \u5728Rocky 9 Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5R\u8f6f\u4ef6<\/h2>\n\n\n\n<p>\u4f7f\u7528\u6e90\u7801\u65b9\u5f0f\u5b89\u88c5R\u8f6f\u4ef6\uff0c\u9700\u8981\u751f\u6210R\u8f6f\u4ef6\u7684\u5e93\u6587\u4ef6libR.so\u3002\u6ce8\u610f\u4f7f\u7528rpm\u6216dnf\u65b9\u5f0f\u5b89\u88c5\u7684R\u8f6f\u4ef6\u53ef\u80fd\u7f3a\u5c11\u8be5\u5e93\u6587\u4ef6\uff0c\u4f1a\u5bfc\u81f4\u540e\u7eedRStudio Server\u4e0d\u80fd\u6210\u529f\u8fd0\u884c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5148\u5b89\u88c5\u4e00\u4e9b\u7cfb\u7edf\u4f9d\u8d56\u7684\u8f6f\u4ef6\nsudo dnf install -y gcc-gfortran readline readline-devel libX11-devel libXt-devel bzip2-devel pcre2-devel libcurl libcurl-devel libtiff-devel libjpeg-turbo-devel pango-devel libpng-devel\u3001\n\n# \u518d\u4e0b\u8f7d\u6e90\u7801\u8fdb\u884c\u7f16\u8bd1\u5b89\u88c5R\u8f6f\u4ef6\uff0c\u6ce8\u610f\u8981\u4f7f\u7528--enable-R-shlib\u53c2\u6570\u7f16\u8bd1\u51falibR.so\u5e93\u6587\u4ef6\u3002\nwget https:\/\/mirrors.tuna.tsinghua.edu.cn\/CRAN\/src\/base\/R-4\/R-4.0.2.tar.gz\ntar zxf R-4.0.2.tar.gz\r\ncd R-4.0.2\/\r\n.\/configure --prefix=\/opt\/sysoft\/R-4.0.2 --enable-R-shlib\r\nmake -j 4\r\nmake install\r\ncd .. &amp;&amp; rm R-4.0.2\/ -rf\r\necho 'PATH=\/opt\/sysoft\/R-4.0.2\/bin\/:$PATH' >> ~\/.bashrc\r\nsource ~\/.bashrc<\/code><\/pre>\n\n\n\n<h2>2. \u5728Rocky 9 Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5RStudio Server\u8f6f\u4ef6 <\/h2>\n\n\n\n<p>\u5b89\u88c5RStudio Server\u8f6f\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/download2.rstudio.org\/server\/rhel9\/x86_64\/rstudio-server-rhel-2024.09.0-375-x86_64.rpm\n# \u6ce8\u610f\u82e5\u662fCentOS 8\u7cfb\u7edf\uff0c\u5219\u9700\u8981\u4e0b\u8f7d\u5176\u5b83\u5bf9\u5e94\u7684rpm\u5305\nsudo dnf install -y rstudio-server-rhel-2024.09.0-375-x86_64.rpm<\/code><\/pre>\n\n\n\n<p>\u9632\u706b\u5899\u5f00\u653e8787\u7aef\u53e3<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>firewall-cmd --add-port=8787\/tcp --permanent\nfirewall-cmd --reload<\/code><\/pre>\n\n\n\n<h2>3. \u914d\u7f6e\u548c\u4f7f\u7528RStudio<\/h2>\n\n\n\n<p>\u82e5\u9700\u8981RStudio\u4f7f\u7528\u6307\u5b9a\u8def\u5f84\u7684R\u8f6f\u4ef6\u6216\u4fee\u6539\u7aef\u53e3\u53f7\uff0c\u5219\u9700\u8981\u9700\u6539\u5176\u914d\u7f6e\u6587\u4ef6\/etc\/rstudio\/rserver.conf\u5185\u5bb9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rsession-which-r=\/opt\/sysoft\/R-4.0.2\/bin\/\/R\nwww-address=0.0.0.0\nwww-port=8787<\/pre>\n\n\n\n<p>\u91cd\u542fRStudio\u670d\u52a1\uff0c\u5373\u53ef\u5728\u6d4f\u89c8\u5668\u603b\u8f93\u5165IP:port\u5373\u53ef\u4f7f\u7528RStudio\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart rstudio-server.service<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5RStudio Server\u7248\u672c\u540e\uff0c\u5373\u53ef\u8fdc\u7a0b\u8bbf\u95ee\u5e76\u4f7f\u7528\u670d\u52a1\u5668\u7684R\u8f6f &hellip; <a href=\"http:\/\/www.chenlianfu.com\/?p=3938\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/3938"}],"collection":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3938"}],"version-history":[{"count":10,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/3938\/revisions"}],"predecessor-version":[{"id":3957,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/3938\/revisions\/3957"}],"wp:attachment":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3938"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}