-
Notifications
You must be signed in to change notification settings - Fork 8
/
INSTALL.txt
executable file
·323 lines (230 loc) · 11.4 KB
/
INSTALL.txt
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
INSTALL
1. Installing Prerequisites:
a. Linux with apt-get
b. Windows
c. Other Platforms
2. Installing Envaya in a development environment
3. Pushing your changes to github
4. Installing and updating Envaya on production servers
==================================================
1a. Installing prerequisites on Linux with apt-get
==================================================
The Linux setup scripts are tested on Debian 8, but may work on
other Linux distributions with apt-get.
The steps below assume that you are installing Envaya in a development
environment. (For production server installation, see the section
"Deploying releases to a production server")
1. Copy Envaya's source code into a world-readable directory.
If you don't already have the source code on your computer, you can do:
apt-get -y install git-core
git clone --recursive git://github.com/youngj/Envaya.git ./envaya
cd envaya
Note: The following commands should be run from a command prompt in
the root directory of the Envaya source code.
They also assume you are running as 'root'.
2. Configure your APT sources
Warning: this will modify your /etc/apt/sources.list file.
./scripts/setup/sources.sh
3. Install basic prerequisites (php, php extensions, wget, rsync, etc.)
./scripts/setup/prereqs.sh
./scripts/setup/php.sh
4. If you don't already have mysql installed, install it.
Warning: if mysql is already installed, this script will reset
the mysql root password to the empty string (should fix this...)
./scripts/setup/mysql.sh
5. Install sphinx (full text search)
./scripts/setup/sphinx.sh
6. Install rabbitmq (task queue)
./scripts/setup/rabbitmq.sh
7. Install dependencies for selenium tests and other development tools:
./scripts/setup/dev.sh
8. (optional) Install some extra programs.
This may take a long time, and most Envaya services will work without this.
./scripts/setup/extras.sh
Also, if your server doesn't already have a browser and/or GUI, you can
install one like so:
apt-get install x-window-system-core gnome-core gdm firefox
Then, reboot into the GUI.
=======================================
1b. Installing prerequisites on Windows
=======================================
1. Install wampserver:
http://www.wampserver.com/en/
These directions assume WAMP is installed to c:\wamp.
2. Install Java JDK 6:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
3. Install cygwin:
http://cygwin.com/install.html
These directions assume cygwin is installed to c:\cygwin.
Select the following 'bin' packages to install:
rsync, openssh, mcrypt, git
5. Modify Path Environment variable. Right-click on "Computer" or "My Computer",
then "Properties", then "Advanced System Settings" or "Advanced", then
"Environment Variables", then find the "Path" variable and click "Edit".
At the end, add:
;c:\cygwin\bin;C:\wamp\bin\php\php5.3.0;C:\wamp\bin\mysql\mysql5.1.36\bin
6. Download Envaya code, e.g.:
cd c:\wamp\www\
git clone --recursive git://github.com/youngj/Envaya.git envaya
cd envaya
7. Install PHP memcache library.
Download it from:
http://downloads.php.net/pierre/php_memcache-cvs-20090703-5.3-VC6-x86.zip
Then extract the zip file and copy the dll to your PHP extension directory:
C:\wamp\bin\php\php5.3.0\ext\
8. Add PHP extensions to your php.ini file.
Edit C:\wamp\bin\php\php5.3.0\php.ini, and search for "extension=". Uncomment
or add the following lines:
extension=php_memcache.dll
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_pdo_mysql.dll
Also, add this to the bottom of your php.ini file:
variables_order="GPCSE"
9. Install dependencies for selenium tests.
From the PEAR directory C:\wamp\bin\php\php5.3.0\PEAR ,
run the following commands:
php -d phar.require_hash=0 go-pear.phar
pear upgrade pear
pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install phpunit/PHPUnit
10. Download and install Sphinx 1.10.
http://sphinxsearch.com/files/sphinx-1.10-beta-win32.zip
Extract the zip file to c:/sphinx
===============================================
1c. Installing Prerequisites on Other Platforms
===============================================
Envaya can also be set up manually on other platforms.
Envaya requires the following prerequisites:
PHP 5.3 or higher, with php-cgi and php-cli
PHP extensions:
curl
gd
json
mbstring
mcrypt
memcache
PDO
pdo_mysql
Mysql
Sphinx 2.04
Rabbitmq
Envaya does not require a separate web server for development, since it
comes with its own PHP development web server, but you can use Apache or Nginx
instead if you like.
To use Apache (with mod_php) as the web server, set DocumentRoot to the full
path to the www/ directory inside this source tree (e.g. C:/path/to/envaya/www),
and make sure that mod_rewrite is enabled.
To use Nginx (with php-fastcgi) as the webserver, see what scripts/setup/nginx.sh
does, and do something like that.
====================
2. Installing Envaya
====================
After you have installed the prerequisites above, run the following
commands in a command prompt in the root directory of Envaya's source code.
1. Create your local configuration file (config/local.php):
php scripts/install_settings.php
2. Edit config/local.php in a text editor to provide settings for
your development environment.
* set admin_email to your own email address
* set your desired database settings
* override any other settings from config/default.php as necessary
If you are using Windows, you will also need to add the following settings
(assuming Sphinx was installed in C:/sphinx):
'sphinx_conf_dir' => 'C:/sphinx',
'sphinx_bin_dir' => 'C:/sphinx/bin',
'sphinx_log_dir' => 'C:/sphinx/log',
'sphinx_pid_dir' => 'C:/sphinx/log',
3. Create empty database and default user:
php scripts/db_setup.php | mysql -u root -p
4. Install database tables and create directory for storing data on filesystem
php scripts/install_tables.php
php scripts/install_dataroot.php
5. Create sphinx config file and initial index, and rabbitmq users
php scripts/install_sphinx.php
php scripts/install_rabbitmq.php
6. Create initial users for testing (should not be used in production)
php scripts/install_test_data.php
This will create several user accounts, including:
(administrator) username:testadmin pw:testtest
username:testorg pw:testtest
username:envaya pw:testtest
7. Make compressed CSS and JS files, etc.:
php make.php
8. Start envaya server processes
php runserver.php
Leave runserver.php running in a command prompt. It should print
the URL of Envaya's home page. Open this URL in a browser.
9. Install latest version of selenium server (for running tests)
php scripts/install_selenium.php
=================================
3. Pushing your changes to github
=================================
Suppose you made a change to Envaya's source code on your local computer
and want to make your changes part of Envaya's official codebase.
To do this, you will first need to push your changes to your own repository
on github, and then submit a pull request on github.
The following steps explain how to do this for the first time:
1. Create a github account if you don't already have one:
https://github.com/signup/free
2. Create a ssh keypair for your computer by running 'ssh-keygen'
in a command prompt, and following the instructions.
When it's done, ssh-keygen should print out something like this:
"Your public key has been saved in /path/to/id_rsa.pub."
3. Copy your ssh public key to your github account settings page.
To do this, open https://github.com/account/ssh , and click the link to
add a public key. Open the public key file generated in the previous
step in a text editor (e.g. "(notepad|gedit) /path/to/id_rsa.pub"),
copy the entire file to the clipboard, and paste the key into
the "Key" textarea. The "Title" field can be anything.
4. Fork the official Envaya repository.
While logged in to github, go to https://github.com/youngj/Envaya
and click the 'Fork' button. It should create a page like:
https://github.com/<your_username>/Envaya
5. Add your new repository as a git remote.
On your new github repository page, there should be a button
labeled "SSH" next to a text box like:
[email protected]:<your_username>/Envaya.git
Copy that to the clipboard, then in a command prompt in your local
Envaya source code directory, run the following command:
git remote add public <pasted_url_from_clipboard>
6. Set your name and email address for git:
git config --global user.name "Firstname Lastname"
git config --global user.email "[email protected]"
7. Whenever you want to push your changes to your github repository
(after committing them locally with "git commit"), run the
following command:
git push public master
8. Whenever you want your changes to be included in the official
Envaya repository, go to https://github.com/<username>/Envaya ,
click the "Pull Request" button, and follow the instructions.
=======================================================
4. Installing and updating Envaya on production servers
=======================================================
This section explains how to deploy Envaya on a public web server like
http://envaya.org . Ignore this section if you are only setting up Envaya
in a development environment, not on a production server.
1. Install Envaya's source code on your local computer as described above.
2. Install the following additional prerequisites:
- Ruby
http://www.ruby-lang.org/en/downloads/
- Capistrano:
gem install capistrano
3. Create a file on your local computer config/production.php with the
local configuration settings for the production server.
(In the next step, this file will be copied to /var/envaya/shared/local.php
on the production server.)
4. Initially, to install all prerequisites and latest Envaya code, but no
particular services, on a server running Debian 8:
cap [HOSTS=<hostname>] deploy:basic_setup
Subsequently, run other deploy:*_setup methods to install particular
services on that host.
== OR ==
To install all prerequisites, latest Envaya code,
and all Envaya services on a single server running Debian 8:
cap [HOSTS=<hostname>] deploy:full_setup
5. Subsequently, to update a server to the latest code:
cap [HOSTS=<hostname>] deploy