This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathINSTALL.txt
310 lines (226 loc) · 11.7 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
==================================================
Plone 4 buildout for http://land.copernicus.eu
==================================================
.. contents ::
Buildout is a tool for easily creating identical development or production
environments. This tool gives you the right versions of Zope, Plone products
and python libraries to ensure that every installation gets exactly the same
configuration.
Everything is installed in a local folder. This prevents conflicts with
already existing python and zope packages. Nothing other than this folder
is touched, so the user doesn't need any special priviliges.
There are three configurations available for running this buildout:
1. one for developers (development)
2. one for production (deployment)
3. one for demonstration (staging)
System requirements and preparation
===============================================
The buildout is intended to run on Linux/Unix-based operating systems. The
buildout has been used and tested on *Debian*, *Ubuntu* for development and *CentOS 5* and *CentoOS 6* for production.
The below system libraries must be installed on the server before you run the buildout. These must be globally
installed by the server administrator.
For CentOS, the EPEL and RPMForge repositories need to be configured before installing
the packages, since some of them are not included in the base repo.
All installs will require the basic GNU build and archive tools: gcc, g++, gmake, gnu tar, gunzip, bunzip2 and patch.
On Debian/Ubuntu systems, this requirement will be taken care of by installing build-essential. On RPM systems (RedHat, Fedora, CentOS), you'll need the gcc-c++ (installs most everything needed as a dependency) and patch RPMs.
==================== ==================== =============================
Debian/Ubuntu CentOS dependency for
==================== ==================== =============================
python 2.7 python 2.7 buildout
python-dev python-devel buildout
wget wget buildout
lynx lynx buildout
tar tar buildout
gcc gcc buildout
git > 1.8.3 git > 1.8.3 buildout
graphviz -- eea.relations
graphviz-gd -- eea.relations
graphviz-dev graphviz-devel eea.relations
ImageMagick > 6.3.7+ ImageMagick > 6.3.7+ eea.relations
libc6-dev glibc-devel buildout
libxml2-dev libxml2-devel buildout
libxslt-dev libxslt-devel buildout
libsvn-dev subversion-devel buildout
libaprutil1-dev apr-util-devel buildout
wv wv http://wvware.sourceforge.net
poppler-utils poppler-utils pdftotext
libjpeg-dev libjpeg-turbo-devel Pillow
libldap2-dev openldap-devel OpenLDAP
libsasl2-dev cyrus-sasl-devel OpenLDAP
pdftk pdftk eea.pdf
readline-dev readline-devel buildout
build-essential make buildout
libz-dev which buildout
libssl-dev openssl-devel buildout
-- patch buildout
-- gcc-c++ buildout
libcurl3-dev curl-devel sparql-client and pycurl2
-- redhat-lsb-core init script
==================== ==================== =============================
Additional info to install git for CentOS::
$ wget http://puias.math.ias.edu/data/puias/computational/6/x86_64/git-1.8.3.1-1.sdl6.x86_64.rpm
$ wget http://puias.math.ias.edu/data/puias/computational/6/i386/perl-Git-1.8.3.1-1.sdl6.noarch.rpm
$ yum update git-1.8.3.1-1.sdl6.x86_64.rpm perl-Git-1.8.3.1-1.sdl6.noarch.rpm
Notes regarding using Copernicus buildout with python2.7 as a Software Collection
---------------------------------------------------------------------------------
Copernicus buildout can be used with python2.7 installed as a Software Collection, but we need to enable the python27 collection
prior to setting up the buildout or trying to manually start/stop the instances generated by the buildout. Enabling the
python27 software collection can easily be done by issueing the following command::
$ scl enable python27 bash
After this, all other commands/operations are the same as those for system python 2.7. The init script and the zopesendmail daemon
have been adapted to work seamlessly with either system python2.7 and Software Collection python2.7, without any additional step
required.
More informations about Software Collection can be found at `https://www.softwarecollections.org/en/`_.
Run buildout for development
----------------------------
The first time you want to use this buildout you first have to get
all software from subversion and then run a few commands::
$ git clone git@github.com:eea/land.copernicus.plonebuildout.git
$ cd land.copernicus.plonebuildout
$ ./install.sh
$ ./bin/buildout -c development.cfg
This first three steps only have to be done the first time you use this
buildout. When you later want to update the site because people have committed
changes you do::
$ cd land.copernicus.plonebuildout
$ git pull -u
$ ./bin/develop rb
To start the application with ZEO support::
$ ./bin/zeoserver start
$ ./bin/www1 start
... and without ZEO support::
$ ./bin/instance start
Now we will have a running Plone buildout. The development buildout by default install ZEO
and two ZEO clients (*./bin/www1* and *./bin/www2*) plus one Zope instance that can be
used without ZEO support (*./bin/instance*).
Run buildout for production (deployment)
----------------------------------------
Some preliminary preparations must be done by system administrators on the deployment server:
* a user and user group called 'zope' should be created having neccesary rights
* the project folder must be created under /var/local/land.copernicus.plonebuildout with group owner zope and 2775 (rwxrwxr-x) mode
* add under /etc/profile:
::
if [ "`id -gn`" = "zope" ]; then
umask 002
fi
The first time you want to use the copernicus plonebuildout you have to run a
few commands (as user zope)::
$ cd /var/local
$ git clone git@github.com:eea/land.copernicus.plonebuildout.git
$ cd land.copernicus.plonebuildout
$ ./install.sh
$ ./bin/buildout -c deployment.cfg
$ chmod -R g+rw .
The above installation process will install and configure, in addition to
Zope and ZEO, the following:
* *Apache* basic configuration
* *Pound* for load balancing ZEO clients
* *Memcache*
* Daemon for sending *emails*
* *ZEO clients* - 2 instances
* *ZEO server*
Processes on production should be started with sudo, e.g::
$ sudo ./bin/memcached start
$ sudo ./bin/zeoserver start
$ sudo ./bin/www1 start
$ sudo ./bin/www2 start
$ sudo ./bin/poundctl start
In case we use python 2.7 as a Software Collection, the above commands should be issued like the following::
$ sudo scl enable python27 -- ./bin/memcached start
$ sudo scl enable python27 -- ./bin/zeoserver start
$ sudo scl enable python27 -- ./bin/www1 start
$ sudo scl enable python27 -- ./bin/www2 start
$ sudo scl enable python27 -- ./bin/poundctl start
In order to avoid this, it is recommended that you use the restart-portal init script generated in
/etc/init.d the script from /var/local/land.copernicus.plonebuildout/etc/rc.d/restart-portal. The script will automatically
use the Software Collection python 2.7 if there is no system python 2.7 without any other user intervention.
For the application stack to be restarted when server reboot, the system
administrator should add under /etc/init.d the script from
/var/local/land.copernicus.plonebuildout/etc/rc.d/restart-portal, e.g.::
$ cd /var/local/land.copernicus.plonebuildout/etc/rc.d
$ ln -s `pwd`/restart-portal /etc/init.d/restart-portal
$ chkconfig --add restart-portal
$ service restart-portal start
Apache configuration file should be symlinked from
/var/local/land.copernicus.plonebuildout/etc/apache-vh.conf under
/etc/httpd/conf.d, this operation should be done by system
administrators, e.g.::
$ ln -s /var/local/land.copernicus.plonebuildout/etc/apache-vh.conf /etc/httpd/conf.d/land-copernicus-apache-vh.conf
Run buildout for staging
----------------------------
Some preliminary preparations must be done by system administrators on the staging server:
* a user and user group called 'zope' should be created having neccesary rights
* the project folder must be created under /var/local/land.copernicus.plonebuildout with group owner zope and 2775 (rwxrwxr-x) mode
* add under /etc/profile:
::
if [ "`id -gn`" = "zope" ]; then
umask 002
fi
The first time you want to use the copernicus plonebuildout you have to run a
few commands (as user zope)::
The first time you want to use this buildout you first have to get
all software from subversion and then run a few commands::
$ git clone git@github.com:eea/land.copernicus.plonebuildout.git staging
$ cd staging
$ ./install.sh
$ ./bin/buildout -c staging.cfg
This first three steps only have to be done the first time you use this
buildout. When you later want to update the site because people have committed
changes you do::
$ cd staging
$ git pull -u
$ ./bin/develop rb
The above installation process will install and configure, in addition to
Zope and ZEO, the following:
* *Apache* basic configuration
* *Pound* for load balancing ZEO clients
* *Memcache*
* Daemon for sending *emails*
* *ZEO clients* - 2 instances
* *ZEO server*
* *Supervisor* for monitor and control the processes: seo, pound, memcached,
www1, www2
To start processess on staging::
$ ./bin/supervisord
If the supervisord is already started you will receive this error::
$ .bin/supervisord
Error: Another program is already listening on a port that one of our HTTP
servers is configured to use. Shut this program down first before starting
supervisord.
For help, use bin/supervisord -h
To start all instance::
$ ./bin/supervisorctl start all
This command will start seo, pound, memcached, www1, www2.
To restart all instance::
$ ./bin/supervisorctrl restart all
To stop all instance::
$ ./bin/supervisorctrl stop all
To see the status for all instance::
$ ./bin/supervisorctl status
To stop only one instance e.g. www1::
$ ./bin/supervisorctl restart www1
To stop supervisor daemon::
$ ./bin/supervisorctl shutdown
User permissions
~~~~~~~~~~~~~~~~
On production server, system administrators should setup:
* umask 002 for all users
* all users members of 'zope' group
Database packing
~~~~~~~~~~~~~~~~
Packing is a vital regular maintenance procedure The Plone database does not automatically prune deleted content. You must periodically pack the database to reclaim space.
Data.fs should be packed daily via a cron job::
01 2 * * * /var/local/land.copernicus.plonebuildout/bin/zeopack
Synchronisation database
~~~~~~~~~~~~~~~~~~~~~~~~
The synchronisation is done by the sync-data.sh via cron job, which is set for
zope user::
0 03 * * Sun /var/local/staging/sync-data.sh >> /var/local/staging/sync-data.log
To edit the cron job for the zope user::
$ crontab -e
The synchronisation script makes logs in sync-data.log.
Portal Property for Google Maps Api Key
---------------------------------------
In ZMI -> portal_properties add a plone property sheet called geographical_properties and inside it add a new string property called google_key.
In this property you have to paste the API KEY, what you can generate at https://developers.google.com/maps/documentation/javascript/v2/introduction#Obtaining_Key
.. _`https://www.softwarecollections.org/en/`: https://www.softwarecollections.org/en/