Skip to content

Instantly share code, notes, and snippets.

@ChefAndy
Forked from eikes/run phoenix on amazon linux.sh
Last active December 4, 2016 07:22
Show Gist options
  • Save ChefAndy/b1199294bad0dd5eaa189cbef8204e44 to your computer and use it in GitHub Desktop.
Save ChefAndy/b1199294bad0dd5eaa189cbef8204e44 to your computer and use it in GitHub Desktop.
run phoenix on amazon linux
# app deps
sudo yum install git
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel openssl-devel
sudo yum install nodejs npm --enablerepo=epel
sudo npm install -g npm
sudo npm -g install brunch
sudo yum install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
sudo service postgresql initdb
#For dev systems, change this line:
#host all all 127.0.0.1/32 ident
#to this:
#host all all 127.0.0.1/32 trust
sudo vim /var/lib/pgsql9/data/pg_hba.conf
# erlang
wget http://www.erlang.org/download/otp_src_19.1.tar.gz
tar -zxvf otp_src_19.1.tar.gz
rm otp_src_19.1.tar.gz
cd otp_src_19.1/
./configure
make
sudo make install
cd ..
# elixir
wget https://github.com/elixir-lang/elixir/archive/v1.3.4.zip
unzip v1.3.4.zip
rm v1.3.4.zip
cd elixir-1.3.4/
make
echo "PATH=\$PATH:/home/ec2-user/elixir-1.3.4/bin" >> ~/.bashrc
cd ..
. ~/.bashrc
# phoenix deps
mix local.hex
# installs the phoenix framework, itself
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez
# listen on port 80 as well
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 4001
ssh github.com
#git clone git://github.com/user_name/my-phonix-app
#cd my-phoenix-app
#npm install
#mix deps.get
#MIX_ENV=prod mix ecto.create
#MIX_ENV=prod mix ecto.migrate
#brunch build --production
#MIX_ENV=prod mix phoenix.digest
#MIX_ENV=prod PORT=4001 elixir --detached -S mix do compile, phoenix.server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment