Elixir/Phoenix Installing to Centos 6

I finally got to the point where I’ve developed something in Elixir and Phoenix that is actually useful for my company. Its a standard web site done in Phoenix. No fancy channel stuff for this. The problem I wanted to solve was to create a browser of internal relational database structures for our product. Stuff that just isn’t available through our UI but is always required by developers or operation folk when troubleshooting and involves fairly involved SQL. Instead of typing in lots and lots of different SQL you can now use this website and navigate to the problem through the links provided.

So, I’ve obviously never deployed a Phoenix app before. I need to deploy it to one of our internal AWS servers that have access to the relational db that the site works against and I need to install it to Centos 6.7 since that is the O/S and version that are installed on these AWS boxes. I’ve developed, explored and tested so far only on my Mac.

To start out with I figured I’d created a Vagrant box with Erlang, Elixir and Phoenix. I documented the steps I used so that someone else in dev or QA could do likewise. Here’s the steps I used :

vagrant init box-cutter/centos67
vagrant up --provider virtualbox
vagrant ssh
sudo su - root
yum install epel-release -y
yum install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel wxBase.x86_64 -y
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
yum update
yum install erlang -y
wget https://github.com/elixir-lang/elixir/archive/v1.3.4.zip
yum install zip
yum install unzip
unzip v1.3.4.zip
cd elixir-1.3.4/
make
make install
mix local.hex
mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez
yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-2.noarch.rpm
yum install postgresql95-server postgresql95 -y
service postgresql-9.5 initdb
service postgresql-9.5 start
chkconfig postgresql-9.5 on
rpm -Uvh https://rpm.nodesource.com/pub_5.x/el/6/x86_64/nodejs-5.10.0-1nodesource.el6.x86_64.rpm
yum install nodejs
yum install inotify-tools
npm install -g brunch

If all of those steps worked then the following commands should execute without a problem :

cd /home
mkdir development
cd development
mix phoenix.new hello_phoenix

Now off to study the Phoenix Deployment page!

Written on October 15, 2016