forked from documentcloud/documentcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathINSTALL
More file actions
174 lines (125 loc) · 4.77 KB
/
Copy pathINSTALL
File metadata and controls
174 lines (125 loc) · 4.77 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
========================= Base DocumentCloud Image ============================
* Use the official Canonical Ubuntu 12.04 LTS 64bit
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
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.0
rvm use 2.1.0 --default
ruby -v
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
sudo gem update --system
git config --global color.ui true
git config --global user.name "Chris Oliver"
git config --global user.email "chris@excid3.com"
ssh-keygen -t rsa -C "chris@excid3.com"
cat ~/.ssh/id_rsa.pub
ssh-add
ssh -T git@github.com
#Hi excid3! You've successfully authenticated, but GitHub does not provide shell access.
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
gem install rails
rbenv rehash
rails -v
# Rails 4.0.2
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.1 libpq-dev
sudo -u postgres createuser chris -s
# If you would like to set a password for the user, you can do the following
sudo -u postgres psql
postgres=# \password chris
#### TESTINT RAILS4
rails new myapp
#### If you want to use MySQL
rails new myapp -d mysql
#### If you want to use Postgres
# Note that this will expect a postgres user with the same username
# as your app, you may need to edit config/database.yml to match the
# user you created earlier
rails new myapp -d postgresql
# Move into the application directory
cd myapp
# If you setup MySQL or Postgres with a username/password, modify the
# config/database.yml file to contain the username/password that you specified
# Create the database
rake db:create
rails server
#INTSTALLAZIONE APACHE MOD PASSENGER AND SSL
sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev
#cREATE SSL CERTIFICATE FOR APACHE2
sudo mkdir -p /etc/apache2/ssl/{crt,key}
sudo openssl req -new -x509 -days 365 -keyout /etc/apache2/ssl/key/server.key -out /etc/apache2/ssl/crt/server.crt -nodes -subj '/O=Ipublic, Ltd/OU=WWW Security Team/CN=dcloud.ntipa.org'
sudo a2enmod rewrite
sudo a2enmod ssl
sudo -s
cat > /etc/apache2/sites-available/dcloud <<EOF
<VirtualHost *:80>
ServerName dcloud.ntipa.org
DocumentRoot /home/tino/develop/rails/documentcloud/public
RailsEnv development
RailsAllowModRewrite off
#<Location />
#RewriteEngine on
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
#</Location>
</VirtualHost>
<VirtualHost *:443>
ServerName dcloud.ntipa.org
DocumentRoot /home/tino/develop/rails/documentcloud/public
RailsEnv development
RailsAllowModRewrite off
SSLEngine On
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
SSLCertificateFile /etc/apache2/ssl/crt/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/key/server.key
SSLVerifyClient optional
SSLVerifyDepth 1
SSLOptions +StdEnvVars +StrictRequire
</VirtualHost>
EOF
exit
sudo a2ensite dcloud
sudo apt-get install mysql-server mysql-client
gem install mysql
gem install passenger
rvmsudo passenger-install-apache2-module
#LoadModule apache manual or
cat > /etc/apache2/mods-available/passenger.load <<EOF
LoadModule passenger_module /home/tino/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so
EOF
cat > /etc/apache2/mods-available/passenger.conf <<EOF
<IfModule mod_passenger.c>
PassengerRoot /home/tino/.rvm/gems/ruby-2.1.0/gems/passenger-4.0.37
PassengerDefaultRuby /home/tino/.rvm/gems/ruby-2.1.0/wrappers/ruby
</IfModule>
EOF
#LoadModule
sudo a2enmod passenger
#ENV CREATE
export RAILS_ENV=development
# setup dummy postgres environment so that you can verify rails is working
sudo cp /etc/postgresql/9.1/main/pg_hba.conf /etc/postgresql/9.1/main/pg_hba.conf_bck
sudo cp config/server/postgres/pg_hba.conf /etc/postgresql/9.1/main/pg_hba.conf
sudo /etc/init.d/postgresql reload
sudo -u postgres createuser -s ubuntu
sudo -u postgres createuser -s documentcloud
sudo -u postgres psql -c "alter user documentcloud password 'documentcloudVirtualMachine' "
sudo -u postgres createdb dcloud_$RAILS_ENV
sudo psql dcloud_$RAILS_ENV -U documentcloud -W
CREATE EXTENSION hstore;
sudo -u postgres psql -f db/structure.sql dcloud_$RAILS_ENV
#start clouwd
export RAILS_ENV=development
crowd -c config/cloud_crowd/development/ load_schema
crowd -c config/cloud_crowd/development/ server -e development
crowd -c config/cloud_crowd/development/ node -e development
#Dopo la traduzione lanciare questo comando per la genrazione dei file javascript
bundle exec rake build:translations