Last active
December 6, 2016 06:39
-
-
Save YoshihitoAso/5583056 to your computer and use it in GitHub Desktop.
[Play2][Scala]Amazon LinuxでPlay2 (scala) 環境を構築する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Play Framework (ver. 2.1.0)をインストール | |
| $ wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip | |
| $ unzip play-2.1.0.zip | |
| .bashrc_profileにPATHを追加 | |
| PATH=$PATH:$HOME/bin:$HOME/play-2.0.3 | |
| 追加したPATHを反映 | |
| . .bash_profile | |
| 疎通確認としてplay helpを実行 | |
| # java開発環境をインストール | |
| $ yum install java-1.6.0-openjdk-devel.x86_64 | |
| # scala をインストール | |
| $ wget http://www.scala-lang.org/downloads/distrib/files/scala-2.10.1.tgz | |
| $ tar xzvf scala-2.10.1.tgz | |
| PATHを通す | |
| # sbt をインストール | |
| $ mkdir ~/bin | |
| $ cd ~/bin | |
| $ wget http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch//0.12.3/sbt-launch.jar | |
| 以下の内容を、sbt という名前のファイルに書いて ~/bin に置く。jar を実行するスクリプト | |
| java -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -jar `dirname $0`/sbt-launch.jar "$@" | |
| $ chmod u+x ~/bin/sbt | |
| # サンプルアプリを作ってみる | |
| $ play new HelloWorld | |
| $ cd HelloWorld | |
| $ play run | |
| http://ec2-54-250-45-82.ap-northeast-1.compute.amazonaws.com:9000 | |
| # サンプルアプリをダウンロードする | |
| $ yum install git | |
| $ git clone git://github.com/tarhashi/Play-AngularJS-Sample.git | |
| $ git checkout -b [ローカルに作成するブランチの名前] [github 上のブランチ (remotes/origin/hogeとか)] | |
| $ play | |
| $ run | |
| http://{hostname}:9000 | |
| # apacheとの連携 | |
| $ yum install httpd | |
| $ vi /etc/httpd/httpd.conf | |
| <VirtualHost *:80> | |
| ProxyPreserveHost On | |
| ProxyPass / http://{hostname}:9000/ | |
| ProxyPassReverse / http://{hostname]:9000/ | |
| </VirtualHost> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment