-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathinstall.sh
More file actions
56 lines (43 loc) · 1.42 KB
/
install.sh
File metadata and controls
56 lines (43 loc) · 1.42 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
#!/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
if ! type ruby > /dev/null; then
mkdir ~/src
cd ~/src
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz
tar -zxf ruby-1.9.3-p429.tar.gz
cd ruby-1.9.3-p429
./configure
make
sudo make install
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
fi
# Need this if ruby dev headers are not there
sudo apt-get -y install ruby-dev
if ! type bundle > /dev/null; then
sudo gem install bundler
fi
# Install Passenger - which will install Nginx
if [ ! -d /opt/nginx ]; then
sudo gem install passenger
sudo passenger-install-nginx-module --auto --prefix=/opt/nginx --auto-download
fi
# 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