5. Step1: Install nginx
5. If you have nginx, you can remove all via this
command bellow:
sudo apt-get remove nginx nginx-full nginx-light nginx-naxsi nginx-common
6. Step2: Install unicorn
1. Go to your app, and add gem ‘unicorn’
2. Create new file config/unicorn.rb with
content as bellow:
8. Step2: Install unicorn
3. Start unicorn via this command
bundle exec unicorn -E development -c
config/unicorn.rb
9. Step2: Install unicorn
4. Start unicorn via service of ubuntu
Create new file vim /etc/init.d/unicorn_sieunhac
10. Step2: Install unicorn
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
### END INIT INFO
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/home/khanhpn/Project/sieunhac_v1
PID=$APP_ROOT/tmp/pids/sieunhac.pid
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E development"
AS_USER=khanhpn
set -u
OLD_PIN="$PID.oldbin"
sig () {