geetarista (owner)

Revisions

gist: 99559 Download_button fork
public
Public Clone URL: git://gist.github.com/99559.git
Embed All Files: show embed
Linode install #
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
 
if [ "$(whoami)" != "root" ]; then
echo "You need to be root to run this!"
  exit 2
fi
 
echo "What is the hostname of the server? "
read hostname
 
echo "What version of Rubygems do you need? "
read rubygems_version
 
echo "What version of Rails will you need? "
read rails_version
 
echo "The following gems are installed with the CMS:"
echo "rails will_paginate rdefensio mysql passenger haml rmagick rspec rspec-rails cucumber populator faker ruport ruport-util geokit"
echo "Enter any other gems you will require (space separated): "
read extra_gems
 
echo "What will the user be called? "
read user_name
 
echo "What will the application be called? "
read app_name
 
apt-get update
aptitude update
 
aptitude install build-essential man apache2 ruby ri irb ruby1.8-dev wget mysql-client mysql-server libmysqlclient15-dev xmkmf libopenssl-ruby apache2-prefork-dev git-core imagemagick libmagick9-dev vim sendmail memcached
 
wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
tar zxvf sphinx-0.9.8.1.tar.gz
cd sphinx-0.9.8.1
./configure --prefix=/usr/local
make
make install
cd ..
rm sphinx-0.9.8.1.tar.gz
rm -rf sphinx-0.9.8.1
 
curl -O http://rubyforge.iasi.roedu.net/files/rubygems/rubygems-${rubygems_version}.tgz
tar -xzvf rubygems-${rubygems_version}.tgz
cd rubygems-${rubygems_version}
ruby setup.rb
cd ..
rm rubygems-${rubygems_version}.tgz
rm -rf rubygems-${rubygems_version}
 
ln -s /usr/bin/gem1.8 /usr/bin/gem
 
gem update --system
 
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
 
gem install rails -v=$rails_version
 
gem install mislav-will_paginate --source=http://gems.github.com
 
gem install mattapayne-rdefensio --source=http://gems.github.com
 
gem install mysql passenger haml rmagick rspec rspec-rails cucumber populator faker ruport ruport-util geokit
 
if $extra_gems
  then
gem install $extra_gems
fi
 
passenger-install-apache2-module
 
# vim /etc/apache2/apache2.conf
echo "LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so" >> /etc/apache2/apache2.conf
echo "PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2" >> /etc/apache2/apache2.conf
echo "PassengerRuby /usr/bin/ruby1.8" >> /etc/apache2/apache2.conf
 
# vim /etc/apache2/sites-available/app-development or whatever
# symlink to /etc/apache2/sites-enabled
 
rm /etc/apache2/sites-enabled/000-default
ln -s /etc/apache2/sites-available/app-development 000-app-development
 
<VirtualHost *:80>
   ServerName www.yourhost.com
   DocumentRoot /somewhere/public
</VirtualHost>
 
apache2ctl restart
 
echo $hostname >> /var/hostname
 
adduser $user_name --home=/var/www/$user_name
 
chmod 755 /var/www/$user_name
 
mysql -p
 
create database $app_name_production
# should it be mysql create database $user_name + "_production";?
 
GRANT all privileges ON $app_name_production.* to "$user_name"@"localhost" IDENTIFIED by '$app_name1001;;';
 
echo "Installation finished."
 
ruby -v
gem -v
/opt/ruby/bin/passenger-status
 
AS USER:
 
cd ~
mkdir .ssh
ssh-keygen
 
# copy id_rsa.pub to github as deploy key
mkdir authorized_keys
cd authorized_keys
# vi authorized_keys
# add keys from devs
# cat id_rsa.pub | pbcopy
 
chmod 600 authorized_keys
 
# git clone git@github.com:offmadisonave/qpm.git (to introduce servers)
 
# add the config/database.yml file
 
# config, index, start for sphinx