Want to subscribe to topics you're interested in?
Become a Member

Hosting Phoenix ( Elixir ) with centmin mod

Discussion in 'Other Web Apps usage' started by Colin, Apr 29, 2016.

  1. Colin

    Colin Active Member

    139
    41
    28
    Oct 7, 2015
    Sheffield UK
    Ratings:
    +102
    Local Time:
    4:48 PM
    1.13.#
    MariaDB 10.1.#
    Centmin mod is running my baby development projects using Phoenix. It's all quite easy too. This won't be for everyone, I may even be alone for a bit. :alien:

    I've saved a lot much time of late with centmin, even with having to figure out centos :) Swapped my dev box to fedora to help overcome the debianisms.

    123.08 and 09 work fine. It's only a nginx config and package install. The centos packages for erlang and elixir are out of date though.

    Code:
    #centos7 deps
    yum install epel-release
    yum -y update && yum -y upgrade
    yum install -y gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git wget
    #centos7 erl
    wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
    rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
    yum install esl-erlang
    mkdir /usr/local/src/elixir
    git clone https://github.com/elixir-lang/elixir.git /usr/local/src/elixir
    cd /usr/local/src/elixir
    make clean test install
    
    :wtf: That's got to get easier...
    GitHub - kerl/kerl: Easy building and installing of Erlang/OTP instances && GitHub - taylor/kiex: Elixir version manager

    I'm building a release on a staging box and experimenting with exrm, YMMV. If you're running cowboy on port 8080 say, all you now need is a modified location block to upgrade the connection.

    Code:
    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header X-Real-IP $remote_addr;  # http://wiki.nginx.org/HttpProxyModule
        proxy_set_header Host $host;  # http://wiki.nginx.org/HttpProxyModule#proxy_pass
        # http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version
        proxy_http_version 1.1; 
    
        # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
      }
    
    Hope that helps someone, probably me in a few weeks when I'm googling...:troll:
     
    Last edited: Apr 29, 2016
    • Informative Informative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    37,258
    8,140
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,532
    Local Time:
    2:48 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    very nice to hear centmin mod is saving you time - it's basically my goal for centmin mod to save folks and myself time :D

    Do you mean you run a site that is using Phoenix framework ? or do you mean that you developed the Phoenix framework and the official site at Phoenix is running on Centmin Mod LEMP ?

    thanks @Colin for sharing - just made my day as it makes me very happy when fellow Centmin Mod users share their experiences and know how :D (y)
     
  3. Colin

    Colin Active Member

    139
    41
    28
    Oct 7, 2015
    Sheffield UK
    Ratings:
    +102
    Local Time:
    4:48 PM
    1.13.#
    MariaDB 10.1.#
    I do mean applications I'm building/tinkering with in phoenix... I'm not even on the % register of clever enough to comprehend what Chris, Jose have achieved. I'll edit it to be clearer.

    I'm working hard to not start work on a opensource forum written in it though. centmin has given me a set of super crutches to re-explore nginx and server config, as a dangerous sysadmin :D I've not broken my staging boxes yet :D As a lone wolf developer I want to spend more time out in the mountains, not in front of my screen.
     
    • Informative Informative x 1
  4. eva2000

    eva2000 Administrator Staff Member

    37,258
    8,140
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,532
    Local Time:
    2:48 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Ah that's made things clearer and yeah time is a precious commodity these days. More of it you save, the better :D
     
..