GithubHelp home page GithubHelp logo

cqzhouchangquan / ubuntu-handy-build Goto Github PK

View Code? Open in Web Editor NEW

This project forked from therealechan/ubuntu-handy-build

0.0 1.0 0.0 12 KB

Build your rail application environment in a handy way

License: MIT License

Ruby 2.69% Shell 97.31%

ubuntu-handy-build's Introduction

  _ __                      _ __                     ___              
 /// //7      _    /7      /// / _   _     _//_ __  / o.)     ()/7 _//
/ U //o\ /7/7/ \/7/_7/7/7 / ` /,'o| / \/7,'o/ \V / / o \ /7/7/7//,'o/ 
\_,'/_,'/__//_n_/// /__/ /_n_/ |_,7/_n_/|__/   )/ /___,'/__/////|__/  
                                              //                      

Run your Rails Application with Passenger + Nginx + MySQL

Usage

# basic config
sh -c "`curl -fsSL https://raw.githubusercontent.com/chankaward/ubuntu-handy-build/master/basic_config.sh`"

# clone this repo and do this locally
$ rake upload_ssh_key

# ssh config
sh -c "`curl -fsSL https://raw.githubusercontent.com/chankaward/ubuntu-handy-build/master/ssh_config.sh`"

# basic env
sh -c "`curl -fsSL https://github.com/chankaward/ubuntu-handy-build/raw/master/basic_env.sh`"

# ruby env
bash -c "`curl -fsSL https://raw.githubusercontent.com/chankaward/ubuntu-handy-build/master/ruby_env.sh`"

# Database
mysql: sh -c "`curl -fsSL https://raw.githubusercontent.com/chankaward/ubuntu-handy-build/master/install_mysql.sh`"
psql : sh -c "`curl -fsSL https://raw.githubusercontent.com/chankaward/ubuntu-handy-build/master/install_psql.sh`"

# install nginx
sh -c "`curl -fsSL https://raw.githubusercontent.com/chankaward/ubuntu-handy-build/master/install_nginx.sh`"

# nginx startup
sh -c "`curl -fsSL https://raw.githubusercontent.com/chankaward/ubuntu-handy-build/master/nginx_init.sh`"

Requirements

  • ubuntu 12.04 && 14.04

Todo

  • add nginx init script
  • refactor
  • write a better README

Follow-up

Update your nginx.conf like below
server {
    listen       80;
    server_name  domain.com; #Your site domain
    rails_env    production; #Rails deploy environment
    root         /var/www/your_site/current/public; #Rails app pubilc folder path
    passenger_enabled on;

    # Comment or delete these lines.
    # location / {
    #     root   html;
    #     index  index.html index.htm;
    # }
}
Authorize application folder to deploy user

I usually place the app in /var/www

$ sudo chown -R deployer:deployer /var/www

Create User and Database for pg

$ sudo su - postgres // Switch to postgres user
$ psql // Sign in postgres background
postgres=# \password postgres // Setup password for postgres user
postgres=# CREATE USER deployer WITH PASSWORD 'password'; // Create a database user for Linux user
postgres=# CREATE DATABASE exampledb OWNER deployer; // Create database
postgres=# GRANT ALL PRIVILEGES ON DATABASE exampledb to deployer; // Authorize deployer user

License

Copyright (c) Edward Chan.

ubuntu-handy-build's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.