Giter Site home page Giter Site logo

deploy's Introduction

##1. The first step is to install some dependencies for Ruby.

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

##2. The installation for rvm is pretty simple:

sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

curl -sSL https://get.rvm.io | bash -s stable

source ~/.rvm/scripts/rvm

rvm install 2.2.2

rvm use 2.2.2 --default

ruby -v

##3. Install Apache

sudo apt-get install apache2

##4. Install postgresql

sudo apt-get update

sudo apt-get install postgresql postgresql-contrib libpq-dev

createdb vto_commerce_development;

create user vto-user password 'Vt0_development';

GRANT ALL PRIVILEGES ON DATABASE mydb TO vto-user;

sudo -u postgres createdb vto_commerce_development --owner=vto_ecommerce

sudo -u postgres createdb vto_commerce_dev --owner=vto_ecommerce

create role vto_development_user with createdb login password 'Vt0Development';

CREATE USER vto_user WITH PASSWORD 'Vt0_development';

GRANT ALL PRIVILEGES ON DATABASE "vto_commerce_development" to vto_user;
sudo su - postgres
psql
create role rolename with createdb login password 'password';

##5. Install imagemagick

apt-get install imagemagick
sudo apt-get install libmagickwand-dev
gem install rmagick

##6. Install Passenger First, install the PGP key for the repository server: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7

Create an APT source file:

sudo nano /etc/apt/sources.list.d/passenger.list

Insert the following line to add the Passenger repository to the file:

deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main

Press CTRL+X to exit, type Y to save the file, and then press ENTER to confirm the file location.

Change the owner and permissions for this file to restrict access to root:

sudo chown root: /etc/apt/sources.list.d/passenger.list

sudo chmod 600 /etc/apt/sources.list.d/passenger.list

Update the APT cache:

sudo apt-get update

Finally, install Passenger:

sudo apt-get install libapache2-mod-passenger

Make sure the Passenger Apache module; it maybe enabled already:

sudo a2enmod passenger

Restart Apache:

sudo service apache2 restart

This step will overwrite our Ruby version to an older one. To resolve this, simply remove the incorrect Ruby location and create a new symlink to the correct Ruby binary file:

Apache config file

<VirtualHost *:80>
    ServerName yappeg.vinova.sg 
    ServerAlias yappge.vinova.sg
    #ServerAlias 172.104.170.135

    DocumentRoot /home/vinova/proj-yappeg/current/public

    RailsEnv staging

    PassengerRuby /home/vinova/.rvm/gems/ruby-2.4.0@yappeg/wrappers/ruby

    <Directory /home/vinova/proj-yappeg/current/public>
        # This relaxes Apache security settings.
        #AllowOverride all
        # MultiViews must be turned off.
        #Options -MultiViews
        # Uncomment this if you're on Apache >= 2.4:
       # Require all granted
	Options FollowSymLinks
        Require all granted
     </Directory>

</VirtualHost>

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.