<Cran Mirror Howto>

http://cran.r-project.org/mirror-howto.html

1. (미러서버) 방화벽 오픈

    ftp.kaist.ac.kr (21,22,80,873)

    cran.r-project.org (21,22,80,873) - 873만 뚫으면 됨.

2. (미러서버) rsync로 데이터 동기화

    rsync -rtlzv --delete cran.r-project.org::CRAN /local/cran/    # kaist의 경우 ftp.kaist.ac.kr::cran (소문자)

3. (미러서버) 아파치 구동 (외부로 80포트 뚫여있어야 함)

    $> vi /etc/httpd/conf/httpd.conf

    ...

    LoadModule rewrite_module modules/mod_rewrite.so       # uncomment

    ...

    AddType text/html .shtml

    ...

    AddHander server-parsed .shtml

    ...

    RewriteEngine on

    RewriteRule /cran/package=(.+) /cran/web/packages/$1/index.html [R=seeother]   # http://XXX/cran/ 을 홈디렉토리로 사용할 경우

    RewriteRule /cran/view=(.+) /cran/web/views/$1.html [R=seeother]

    $> /etc/init.d/httpd restart

4. (클라이언트 서버) CRAN repository 사이트 설정

    $> touch R_HOME/etc/Rprofile.site  # touch /usr/lib64/R/etc/Rprofile.site

    $> cd R_HOME/etc/Rprofile.site

    $> vi Rprofile.site

    options(repos=c(CRAN="http://미러서버아이피/cran"))

     

<rocks clusters>

$> cp R_HOME/etc/Rprofile.site /export

$> rocks run host "mount -t nfs masterHostName:/export /mnt"

$> rocks run host "cp /mnt/Rprofile.site R_HOME/etc/"

$> rocks run host "umount /mnt"

$> rm /export/Rprofile.site

 

* 완료 테스트

R> install.packages("ggplot2")  # over R version 2.14

R> install.packages("ENmisc")

 

Posted by 옥탑방람보
,