forked from ballistiq/ruby-passenger-nginx-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
44 lines (35 loc) · 1.23 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Store the base dir
BASEDIR=$( cd $(dirname $0); pwd)
# Get all dependencies
sudo apt-get update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev curl git-core python-software-properties libsqlite3-dev
# Stuff used by Ballistiq often
# ImageMagick (used by Paperclip gem)
sudo apt-get -y install zip unzip imagemagick
# MySQL headers. Required by mysql2 gem
sudo apt-get -y install libmysql++-dev
# Install Ruby
mkdir ~/src
cd ~/src
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.gz
tar -zxf ruby-1.9.3-p286.tar.gz
cd ruby-1.9.3-p286
./configure
make
sudo make install
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
sudo gem install bundler
# Install Passenger - which will install Nginx
sudo gem install passenger
sudo passenger-install-nginx-module --auto --prefix=/opt/nginx --auto-download
# Install the control nginx control script
sudo cp $BASEDIR/nginx.initd /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo update-rc.d -f nginx defaults
# Add log rotation to nginx
sudo cp $BASEDIR/nginx.logrotate /etc/logrotate.d/nginx
# Use service to start nginx
sudo service nginx start