Skip to content

Instantly share code, notes, and snippets.

@z3cka
Forked from anonymous/README_rhel6.md
Last active November 8, 2017 17:59
Show Gist options
  • Save z3cka/7d7454df061430d3c0471f50ba5128e7 to your computer and use it in GitHub Desktop.
Save z3cka/7d7454df061430d3c0471f50ba5128e7 to your computer and use it in GitHub Desktop.
SHARE Analytics on Red Hat 6

Requirements

  • install git sudo yum install git

  • build deps for python via pyenv sudo yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel

  • more db deps sudo yum install -y postgresql postgresql-server postgresql-contrib postgresql-devel

  • "initialize the postgres cluster sudo service postgresql initdb && \ sudo service postgresql start

  • install NVM curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

  • install pyenv + pyenv-virtualenv via installer curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash

  • export path for pyenv vim ~/.bashrc insert at end of file:

    export PATH="/home/cgrzecka/.pyenv/bin:$PATH"
    eval "$(pyenv init -)"
    eval "$(pyenv virtualenv-init -)"
    
  • exit terminal to pick-up NVM & pyenv path on next login exit

  • install pyenv-virtualenvwrapper pyenv install 2.7.7 && pyenv global 2.7.7 git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper

Project

  • clone project and switch into new dir git clone https://github.com/cos-labs/share-analytics.git && cd share-analytics/

  • install node LTS (tested with LTS at the time: node v6.11.?) nvm install --lts

  • install node requirements (could be moved to requirements) npm install

  • install bower "globally" (could be moved to requirements) npm install -g bower bower install

  • install ember-cli globally npm install -g ember-cli

  • set up your config/local.yml

    • (If this file does not exist, you will need to ember g (ember generate))
    • ./node_modules/ember-cli/bin/ember generate ember-osf
    • OR
    • ember g ember-osf
  • npm install -g watchman or maybe don't do this

  • create a new virtualenv pyenv install 3.5.3 && \ pyenv virtualenv 3.5.3 env-3.5.3 && \ pyenv virtualenvwrapper

  • change into service directory: cd service

  • set python version for service directory pyenv activate env-3.5.3

  • set up postgres db for our app

    • switch to postgres user: sudo su postgres

    • enter the postgres terminal: psql

    • create database: postgres=# CREATE DATABASE shareanalytics;

    • create postgres user: postgres= CREATE USER shareanalyticsuser WITH PASSWORD 'sharingiscaring';

    • set django specific settings for postgres

        ALTER ROLE shareanalyticsuser SET client_encoding TO 'utf8';
        ALTER ROLE shareanalyticsuser SET default_transaction_isolation TO 'read committed';
        ALTER ROLE shareanalyticsuser SET timezone TO 'UTC';
      
    • Grant perms: postgres=# GRANT ALL PRIVILEGES ON DATABASE shareanalytics TO shareanalyticsuser;

    • quit postgres terminal: postgres=# \q

    • exit postgres user exit

    • set host to use password via: sudo vim /var/lib/pgsql/data/pg_hba.conf host all all 127.0.0.1/32 password

  • restart postgresql: sudo service postgresql restart

Running / Development

change to root of repo ember serve or (in my case) ./node_modules/ember-cli/bin/ember serve from service dir: ./manage.py runserver Visit your app at http://your-domain-or-IP:4200/

versions of things as of 6/6/2017

red hat 6.9 python 3.5.3 postgresql 8.4 node v6.11.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment