Javaな日々

NO JAVA, NO LIFE.

CentOS に Play Framework をインストールする

環境

手順

  1. Play Framework 公式サイト から本体をダウンロード,解凍して配置,インストール.

    [admin ~]$ wget http://download.playframework.org/releases/play-2.0.4.zip
    --2013-01-06 12:52:34--  http://download.playframework.org/releases/play-2.0.4.zip
    download.playframework.org をDNSに問いあわせています... 88.190.20.213
    download.playframework.org|88.190.20.213|:80 に接続しています... 接続しました。
    HTTP による接続要求を送信しました、応答を待っています... 200 OK
    長さ: 101288372 (97M) [application/zip]
    `play-2.0.4.zip' に保存中
    
    100%[================>] 101,288,372 5.33M/s 時間 21s     
    
    2013-01-06 12:52:57 (4.51 MB/s) - `play-2.0.4.zip' へ保存完了 [101288372/101288372]
    
    [admin ~]$ unzip play-2.0.4.zip 
    [admin ~]$ sudo mv play-2.0.4/ /usr/local
    [admin ~]$ cd /usr/bin
    [admin bin]$ sudo ln -s /usr/local/play-2.0.4/play play
    [admin ~]$ cd ~
    [admin ~]$ play
    Getting net.java.dev.jna jna 3.2.3 ...
    :: retrieving :: org.scala-sbt#boot-app
    	confs: [default]
    	1 artifacts copied, 0 already retrieved (838kB/24ms)
    Getting Scala 2.9.1 (for console)...
    :: retrieving :: org.scala-sbt#boot-scala
    	confs: [default]
    	4 artifacts copied, 0 already retrieved (19939kB/72ms)
    Getting play console_2.9.1 2.0.4 ...
    :: retrieving :: org.scala-sbt#boot-app
    	confs: [default]
    	5 artifacts copied, 0 already retrieved (3667kB/28ms)
           _            _ 
     _ __ | | __ _ _  _| |
    | '_ \| |/ _' | || |_|
    |  __/|_|\____|\__ (_)
    |_|            |__/ 
                 
    play! 2.0.4, http://www.playframework.org
    
    This is not a play application!
    
    Use `play new` to create a new Play application in the current directory, 
    or go to an existing application and launch the development console using `play`.
    
    You can also browse the complete documentation at http://www.playframework.org.

  2. Play 用のポート 9000 番を開放.

    [admin ~]$ sudo vi /etc/sysconfig/iptables

    各自自分の環境に合わせて iptables を書き換える.

    -A INPUT -p tcp --dport 9000 -j ACCEPT

    設定を適用.

    [admin ~]$ sudo /etc/rc.d/init.d/iptables restart