Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hectorddmx/d0c1287f7938374533e4b7363b888e19 to your computer and use it in GitHub Desktop.

Select an option

Save hectorddmx/d0c1287f7938374533e4b7363b888e19 to your computer and use it in GitHub Desktop.

Revisions

  1. hectorddmx revised this gist Mar 9, 2018. 1 changed file with 26 additions and 16 deletions.
    42 changes: 26 additions & 16 deletions run phoenix on amazon linux.sh
    Original file line number Diff line number Diff line change
    @@ -1,28 +1,38 @@
    export LANG="en_US.UTF-8"
    export LC_CTYPE="en_US.UTF-8"

    cd /

    # app deps
    yum install git
    yum install git -y

    # erlang deps
    yum groupinstall "Development Tools"
    yum install ncurses-devel
    yum install wget

    yum install ncurses-devel openssl-devel -y
    yum groupinstall "Development Tools" -y
    yum install wget -y
    # erlang
    wget http://www.erlang.org/download/otp_src_20.0.tar.gz
    cd /tmp
    wget -nc http://www.erlang.org/download/otp_src_20.0.tar.gz
    tar -zxvf otp_src_20.0.tar.gz
    rm otp_src_20.0.tar.gz
    # rm otp_src_20.0.tar.gz
    cd otp_src_20.0/
    ./configure
    make
    make install
    make && make install

    # elixir
    wget https://github.com/elixir-lang/elixir/archive/v1.6.1.zip
    unzip v1.6.1.zip
    cd /tmp
    wget "https://github.com/elixir-lang/elixir/archive/v1.6.1.tar.gz"
    tar xfz v1.6.1.tar.gz
    cd elixir-1.6.1/
    make
    echo "PATH=\$PATH:/home/ec2-user/elixir-1.6.1/bin" >> .bashrc
    # wget -nc https://github.com/elixir-lang/elixir/archive/v1.6.1.zip
    # unzip v1.6.1.zip
    # cd elixir-1.6.1/
    export PATH="${PATH}:/usr/local/bin"
    make && make install

    mix local.hex --force
    mix local.rebar --force

    # phoenix deps
    yum install postgresql
    mix local.hex
    yum install nodejs npm --enablerepo=epel
    npm -g install brunch
    yum -y install postgresql
  2. hectorddmx revised this gist Mar 9, 2018. 1 changed file with 16 additions and 31 deletions.
    47 changes: 16 additions & 31 deletions run phoenix on amazon linux.sh
    Original file line number Diff line number Diff line change
    @@ -1,43 +1,28 @@
    # app deps
    sudo yum install git
    yum install git

    # erlang deps
    sudo yum groupinstall "Development Tools"
    sudo yum install ncurses-devel

    yum groupinstall "Development Tools"
    yum install ncurses-devel
    yum install wget
    # erlang
    wget http://www.erlang.org/download/otp_src_18.1.tar.gz
    tar -zxvf otp_src_18.1.tar.gz
    rm otp_src_18.1.tar.gz
    cd otp_src_18.1/
    wget http://www.erlang.org/download/otp_src_20.0.tar.gz
    tar -zxvf otp_src_20.0.tar.gz
    rm otp_src_20.0.tar.gz
    cd otp_src_20.0/
    ./configure
    make
    sudo make install
    make install

    # elixir
    wget https://github.com/elixir-lang/elixir/archive/v1.1.1.zip
    unzip v1.1.1.zip
    cd elixir-1.1.1/
    wget https://github.com/elixir-lang/elixir/archive/v1.6.1.zip
    unzip v1.6.1.zip
    cd elixir-1.6.1/
    make
    echo "PATH=\$PATH:/home/ec2-user/elixir-1.1.1/bin" >> .bashrc
    echo "PATH=\$PATH:/home/ec2-user/elixir-1.6.1/bin" >> .bashrc

    # phoenix deps
    sudo yum install postgresql
    yum install postgresql
    mix local.hex
    sudo yum install nodejs npm --enablerepo=epel
    sudo npm -g install brunch

    # listen on port 80 as well
    sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 4001

    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

    yum install nodejs npm --enablerepo=epel
    npm -g install brunch
  3. @eikes eikes created this gist Dec 28, 2015.
    43 changes: 43 additions & 0 deletions run phoenix on amazon linux.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    # app deps
    sudo yum install git

    # erlang deps
    sudo yum groupinstall "Development Tools"
    sudo yum install ncurses-devel

    # erlang
    wget http://www.erlang.org/download/otp_src_18.1.tar.gz
    tar -zxvf otp_src_18.1.tar.gz
    rm otp_src_18.1.tar.gz
    cd otp_src_18.1/
    ./configure
    make
    sudo make install

    # elixir
    wget https://github.com/elixir-lang/elixir/archive/v1.1.1.zip
    unzip v1.1.1.zip
    cd elixir-1.1.1/
    make
    echo "PATH=\$PATH:/home/ec2-user/elixir-1.1.1/bin" >> .bashrc

    # phoenix deps
    sudo yum install postgresql
    mix local.hex
    sudo yum install nodejs npm --enablerepo=epel
    sudo npm -g install brunch

    # listen on port 80 as well
    sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 4001

    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