root / docs / quick-install-admin-guide.rst @ a96ec00f
History | View | Annotate | Download (20.3 kB)
1 | bdb83fd6 | cven | .. _quick-install-admin-guide: |
---|---|---|---|
2 | bdb83fd6 | cven | |
3 | bdb83fd6 | cven | Administrator's Quick Installation Guide |
4 | a96ec00f | Constantinos Venetsanopoulos | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
5 | a96ec00f | Constantinos Venetsanopoulos | |
6 | a96ec00f | Constantinos Venetsanopoulos | This is the Administrator's quick installation guide. |
7 | a96ec00f | Constantinos Venetsanopoulos | |
8 | a96ec00f | Constantinos Venetsanopoulos | It describes how to install the whole synnefo stack on two (2) physical nodes, |
9 | a96ec00f | Constantinos Venetsanopoulos | with minimum configuration. It installs synnefo from Debian packages, and |
10 | a96ec00f | Constantinos Venetsanopoulos | assumes the nodes run Debian Squeeze. After successful installation, you will |
11 | a96ec00f | Constantinos Venetsanopoulos | have the following services running: |
12 | a96ec00f | Constantinos Venetsanopoulos | |
13 | a96ec00f | Constantinos Venetsanopoulos | * Identity Management (Astakos) |
14 | a96ec00f | Constantinos Venetsanopoulos | * File Storage Service (Pithos+) |
15 | a96ec00f | Constantinos Venetsanopoulos | * Compute Service (Cyclades) |
16 | a96ec00f | Constantinos Venetsanopoulos | * Image Registry Service (Plankton) |
17 | a96ec00f | Constantinos Venetsanopoulos | |
18 | a96ec00f | Constantinos Venetsanopoulos | and a single unified Web UI to manage them all. |
19 | a96ec00f | Constantinos Venetsanopoulos | |
20 | a96ec00f | Constantinos Venetsanopoulos | The Volume Storage Service (Archipelago) and the Billing Service (Aquarium) are |
21 | a96ec00f | Constantinos Venetsanopoulos | not released yet. |
22 | a96ec00f | Constantinos Venetsanopoulos | |
23 | a96ec00f | Constantinos Venetsanopoulos | If you just want to install the File Storage Service (Pithos+), follow the guide |
24 | a96ec00f | Constantinos Venetsanopoulos | and just stop after the "Testing of Pithos+" section. |
25 | a96ec00f | Constantinos Venetsanopoulos | |
26 | a96ec00f | Constantinos Venetsanopoulos | |
27 | a96ec00f | Constantinos Venetsanopoulos | Installation of Synnefo / Introduction |
28 | a96ec00f | Constantinos Venetsanopoulos | ====================================== |
29 | a96ec00f | Constantinos Venetsanopoulos | |
30 | a96ec00f | Constantinos Venetsanopoulos | We will install the services with the above list's order. Cyclades and Plankton |
31 | a96ec00f | Constantinos Venetsanopoulos | will be installed in a single step (at the end), because at the moment they are |
32 | a96ec00f | Constantinos Venetsanopoulos | contained in the same software component. Furthermore, we will install all |
33 | a96ec00f | Constantinos Venetsanopoulos | services in the first physical node, except Pithos+ which will be installed in |
34 | a96ec00f | Constantinos Venetsanopoulos | the second, due to a conflict between the snf-pithos-app and snf-cyclades-app |
35 | a96ec00f | Constantinos Venetsanopoulos | component (scheduled to be fixed in the next version). |
36 | a96ec00f | Constantinos Venetsanopoulos | |
37 | a96ec00f | Constantinos Venetsanopoulos | For the rest of the documentation we will refer to the first physical node as |
38 | a96ec00f | Constantinos Venetsanopoulos | "node1" and the second as "node2". We will also assume that their domain names |
39 | a96ec00f | Constantinos Venetsanopoulos | are "node1.example.com" and "node2.example.com" and their IPs are "4.3.2.1" and |
40 | a96ec00f | Constantinos Venetsanopoulos | "4.3.2.2" respectively. |
41 | a96ec00f | Constantinos Venetsanopoulos | |
42 | a96ec00f | Constantinos Venetsanopoulos | |
43 | a96ec00f | Constantinos Venetsanopoulos | General Prerequisites |
44 | a96ec00f | Constantinos Venetsanopoulos | ===================== |
45 | a96ec00f | Constantinos Venetsanopoulos | |
46 | a96ec00f | Constantinos Venetsanopoulos | These are the general synnefo prerequisites, that you need on node1 and node2 |
47 | a96ec00f | Constantinos Venetsanopoulos | and are related to all the services (Astakos, Pithos+, Cyclades, Plankton). |
48 | a96ec00f | Constantinos Venetsanopoulos | |
49 | a96ec00f | Constantinos Venetsanopoulos | To be able to download all synnefo components you need to add the following |
50 | a96ec00f | Constantinos Venetsanopoulos | lines in your ``/etc/apt/sources.list`` file: |
51 | a96ec00f | Constantinos Venetsanopoulos | |
52 | a96ec00f | Constantinos Venetsanopoulos | | ``deb http://apt.dev.grnet.gr squeeze main`` |
53 | a96ec00f | Constantinos Venetsanopoulos | | ``deb-src http://apt.dev.grnet.gr squeeze main`` |
54 | a96ec00f | Constantinos Venetsanopoulos | |
55 | a96ec00f | Constantinos Venetsanopoulos | | ``deb http://apt.noc.grnet.gr experimental main`` |
56 | a96ec00f | Constantinos Venetsanopoulos | | ``deb-src http://apt.noc.grnet.gr experimental main`` |
57 | a96ec00f | Constantinos Venetsanopoulos | |
58 | a96ec00f | Constantinos Venetsanopoulos | | ``deb http://apt.noc.grnet.gr squeeze backports`` |
59 | a96ec00f | Constantinos Venetsanopoulos | | ``deb-src http://apt.noc.grnet.gr squeeze backports`` |
60 | a96ec00f | Constantinos Venetsanopoulos | |
61 | a96ec00f | Constantinos Venetsanopoulos | You also need a shared directory visible by both nodes. Pithos+ will save all |
62 | a96ec00f | Constantinos Venetsanopoulos | data inside this directory. By 'all data', we mean files, images, and pithos |
63 | a96ec00f | Constantinos Venetsanopoulos | specific mapping data. If you plan to upload more than one basic image, this |
64 | a96ec00f | Constantinos Venetsanopoulos | directory should have at least 50GB of free space. During this guide, we will |
65 | a96ec00f | Constantinos Venetsanopoulos | assume that node1 acts as an NFS server and serves the directory ``/srv/pithos`` |
66 | a96ec00f | Constantinos Venetsanopoulos | to node2. Node2 has this directory mounted under ``/srv/pithos``, too. |
67 | a96ec00f | Constantinos Venetsanopoulos | |
68 | a96ec00f | Constantinos Venetsanopoulos | Before starting the synnefo installation, you will need basic third party |
69 | a96ec00f | Constantinos Venetsanopoulos | software to be installed and configured on the physical nodes. We will describe |
70 | a96ec00f | Constantinos Venetsanopoulos | each node's general prerequisites separately. Any additional configuration, |
71 | a96ec00f | Constantinos Venetsanopoulos | specific to a synnefo service for each node, will be described at the service's |
72 | a96ec00f | Constantinos Venetsanopoulos | section. |
73 | a96ec00f | Constantinos Venetsanopoulos | |
74 | a96ec00f | Constantinos Venetsanopoulos | Node1 |
75 | a96ec00f | Constantinos Venetsanopoulos | ----- |
76 | a96ec00f | Constantinos Venetsanopoulos | |
77 | a96ec00f | Constantinos Venetsanopoulos | General Synnefo dependencies |
78 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
79 | a96ec00f | Constantinos Venetsanopoulos | |
80 | a96ec00f | Constantinos Venetsanopoulos | * apache (http server) |
81 | a96ec00f | Constantinos Venetsanopoulos | * gunicorn (WSGI http server) |
82 | a96ec00f | Constantinos Venetsanopoulos | * postgresql (database) |
83 | a96ec00f | Constantinos Venetsanopoulos | * rabbitmq (message queue) |
84 | a96ec00f | Constantinos Venetsanopoulos | |
85 | a96ec00f | Constantinos Venetsanopoulos | You can install the above by running: |
86 | a96ec00f | Constantinos Venetsanopoulos | |
87 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
88 | a96ec00f | Constantinos Venetsanopoulos | |
89 | a96ec00f | Constantinos Venetsanopoulos | # apt-get install apache2 gunicorn postgresql |
90 | a96ec00f | Constantinos Venetsanopoulos | |
91 | a96ec00f | Constantinos Venetsanopoulos | Make sure you have installed gunicorn >= v0.12.2. On node1, we will create our |
92 | a96ec00f | Constantinos Venetsanopoulos | databases, so you will also need the python-psycopg2 package: |
93 | a96ec00f | Constantinos Venetsanopoulos | |
94 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
95 | a96ec00f | Constantinos Venetsanopoulos | |
96 | a96ec00f | Constantinos Venetsanopoulos | # apt-get install python-psycopg2 |
97 | a96ec00f | Constantinos Venetsanopoulos | |
98 | a96ec00f | Constantinos Venetsanopoulos | Database setup |
99 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~ |
100 | a96ec00f | Constantinos Venetsanopoulos | |
101 | a96ec00f | Constantinos Venetsanopoulos | On node1, we create a database called ``snf_apps``, that will host all django |
102 | a96ec00f | Constantinos Venetsanopoulos | apps related tables. We also create the user ``synnefo`` and grant him all |
103 | a96ec00f | Constantinos Venetsanopoulos | privileges on the database. We do this by running: |
104 | a96ec00f | Constantinos Venetsanopoulos | |
105 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
106 | a96ec00f | Constantinos Venetsanopoulos | |
107 | a96ec00f | Constantinos Venetsanopoulos | root@node1:~ # su - postgres |
108 | a96ec00f | Constantinos Venetsanopoulos | postgres@node1:~ $ psql |
109 | a96ec00f | Constantinos Venetsanopoulos | postgres=# CREATE DATABASE snf_apps WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0; |
110 | a96ec00f | Constantinos Venetsanopoulos | postgres=# CREATE USER synnefo WITH PASSWORD 'example_passw0rd'; |
111 | a96ec00f | Constantinos Venetsanopoulos | postgres=# GRANT ALL PRIVILEGES ON DATABASE snf_apps TO synnefo; |
112 | a96ec00f | Constantinos Venetsanopoulos | |
113 | a96ec00f | Constantinos Venetsanopoulos | We also create the database ``snf_pithos`` needed by the pithos+ backend and |
114 | a96ec00f | Constantinos Venetsanopoulos | grant the ``synnefo`` user all privileges on the database. This database could |
115 | a96ec00f | Constantinos Venetsanopoulos | be created on node2 instead, but we do it on node1 for simplicity. We will |
116 | a96ec00f | Constantinos Venetsanopoulos | create all needed databases on node1 and then node2 will connect to them. |
117 | a96ec00f | Constantinos Venetsanopoulos | |
118 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
119 | a96ec00f | Constantinos Venetsanopoulos | |
120 | a96ec00f | Constantinos Venetsanopoulos | postgres=# CREATE DATABASE snf_pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' |
121 | a96ec00f | Constantinos Venetsanopoulos | postgres=# GRANT ALL PRIVILEGES ON DATABASE snf_pithos TO synnefo; |
122 | a96ec00f | Constantinos Venetsanopoulos | |
123 | a96ec00f | Constantinos Venetsanopoulos | Configure the database to listen to all network interfaces. You can do this by |
124 | a96ec00f | Constantinos Venetsanopoulos | editting the file ``/etc/postgresql/8.4/main/postgresql.conf`` and change |
125 | a96ec00f | Constantinos Venetsanopoulos | ``listen_addresses`` to ``'*'`` : |
126 | a96ec00f | Constantinos Venetsanopoulos | |
127 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
128 | a96ec00f | Constantinos Venetsanopoulos | |
129 | a96ec00f | Constantinos Venetsanopoulos | listen_addresses = '*' |
130 | a96ec00f | Constantinos Venetsanopoulos | |
131 | a96ec00f | Constantinos Venetsanopoulos | Furthermore, edit ``/etc/postgresql/8.4/main/pg_hba.conf`` to allow node1 and |
132 | a96ec00f | Constantinos Venetsanopoulos | node2 to connect to the database. Add the following lines under ``#IPv4 local |
133 | a96ec00f | Constantinos Venetsanopoulos | connections:`` : |
134 | a96ec00f | Constantinos Venetsanopoulos | |
135 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
136 | a96ec00f | Constantinos Venetsanopoulos | |
137 | a96ec00f | Constantinos Venetsanopoulos | host all all 4.3.2.1/32 md5 |
138 | a96ec00f | Constantinos Venetsanopoulos | host all all 4.3.2.2/32 md5 |
139 | a96ec00f | Constantinos Venetsanopoulos | |
140 | a96ec00f | Constantinos Venetsanopoulos | Make sure to substitute "4.3.2.1" and "4.3.2.2" with node1's and node2's |
141 | a96ec00f | Constantinos Venetsanopoulos | actual IPs. Now, restart the server to apply the changes: |
142 | a96ec00f | Constantinos Venetsanopoulos | |
143 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
144 | a96ec00f | Constantinos Venetsanopoulos | |
145 | a96ec00f | Constantinos Venetsanopoulos | # /etc/init.d/postgresql restart |
146 | a96ec00f | Constantinos Venetsanopoulos | |
147 | a96ec00f | Constantinos Venetsanopoulos | Gunicorn setup |
148 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~ |
149 | a96ec00f | Constantinos Venetsanopoulos | |
150 | a96ec00f | Constantinos Venetsanopoulos | Create the file ``synnefo`` under ``/etc/gunicorn.d/`` containing the following: |
151 | a96ec00f | Constantinos Venetsanopoulos | |
152 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
153 | a96ec00f | Constantinos Venetsanopoulos | |
154 | a96ec00f | Constantinos Venetsanopoulos | CONFIG = { |
155 | a96ec00f | Constantinos Venetsanopoulos | 'mode': 'django', |
156 | a96ec00f | Constantinos Venetsanopoulos | 'environment': { |
157 | a96ec00f | Constantinos Venetsanopoulos | 'DJANGO_SETTINGS_MODULE': 'synnefo.settings', |
158 | a96ec00f | Constantinos Venetsanopoulos | }, |
159 | a96ec00f | Constantinos Venetsanopoulos | 'working_dir': '/etc/synnefo', |
160 | a96ec00f | Constantinos Venetsanopoulos | 'user': 'www-data', |
161 | a96ec00f | Constantinos Venetsanopoulos | 'group': 'www-data', |
162 | a96ec00f | Constantinos Venetsanopoulos | 'args': ( |
163 | a96ec00f | Constantinos Venetsanopoulos | '--bind=127.0.0.1:8080', |
164 | a96ec00f | Constantinos Venetsanopoulos | '--workers=4', |
165 | a96ec00f | Constantinos Venetsanopoulos | '--log-level=debug', |
166 | a96ec00f | Constantinos Venetsanopoulos | ), |
167 | a96ec00f | Constantinos Venetsanopoulos | } |
168 | a96ec00f | Constantinos Venetsanopoulos | |
169 | a96ec00f | Constantinos Venetsanopoulos | !!! Warning: Do NOT start the server yet, because it won't find the |
170 | a96ec00f | Constantinos Venetsanopoulos | ``synnefo.settings`` module. We will start the server after successful |
171 | a96ec00f | Constantinos Venetsanopoulos | installation of astakos. If the server is running: |
172 | a96ec00f | Constantinos Venetsanopoulos | |
173 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
174 | a96ec00f | Constantinos Venetsanopoulos | |
175 | a96ec00f | Constantinos Venetsanopoulos | # /etc/init.d/gunicorn stop |
176 | a96ec00f | Constantinos Venetsanopoulos | |
177 | a96ec00f | Constantinos Venetsanopoulos | Apache2 setup |
178 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~ |
179 | a96ec00f | Constantinos Venetsanopoulos | |
180 | a96ec00f | Constantinos Venetsanopoulos | Create the file ``synnefo`` under ``/etc/apache2/sites-available/`` containing |
181 | a96ec00f | Constantinos Venetsanopoulos | the following: |
182 | a96ec00f | Constantinos Venetsanopoulos | |
183 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
184 | a96ec00f | Constantinos Venetsanopoulos | |
185 | a96ec00f | Constantinos Venetsanopoulos | <VirtualHost *:80> |
186 | a96ec00f | Constantinos Venetsanopoulos | ServerName node1.example.com |
187 | a96ec00f | Constantinos Venetsanopoulos | |
188 | a96ec00f | Constantinos Venetsanopoulos | RewriteEngine On |
189 | a96ec00f | Constantinos Venetsanopoulos | RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
190 | a96ec00f | Constantinos Venetsanopoulos | </VirtualHost> |
191 | a96ec00f | Constantinos Venetsanopoulos | |
192 | a96ec00f | Constantinos Venetsanopoulos | Create the file ``synnefo-ssl`` under ``/etc/apache2/sites-available/`` |
193 | a96ec00f | Constantinos Venetsanopoulos | containing the following: |
194 | a96ec00f | Constantinos Venetsanopoulos | |
195 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
196 | a96ec00f | Constantinos Venetsanopoulos | |
197 | a96ec00f | Constantinos Venetsanopoulos | <IfModule mod_ssl.c> |
198 | a96ec00f | Constantinos Venetsanopoulos | <VirtualHost _default_:443> |
199 | a96ec00f | Constantinos Venetsanopoulos | ServerName node1.example.com |
200 | a96ec00f | Constantinos Venetsanopoulos | |
201 | a96ec00f | Constantinos Venetsanopoulos | Alias /static "/usr/share/synnefo/static" |
202 | a96ec00f | Constantinos Venetsanopoulos | |
203 | a96ec00f | Constantinos Venetsanopoulos | # SetEnv no-gzip |
204 | a96ec00f | Constantinos Venetsanopoulos | # SetEnv dont-vary |
205 | a96ec00f | Constantinos Venetsanopoulos | |
206 | a96ec00f | Constantinos Venetsanopoulos | RequestHeader set X-Forwarded-Protocol "https" |
207 | a96ec00f | Constantinos Venetsanopoulos | |
208 | a96ec00f | Constantinos Venetsanopoulos | <Proxy * > |
209 | a96ec00f | Constantinos Venetsanopoulos | Order allow,deny |
210 | a96ec00f | Constantinos Venetsanopoulos | Allow from all |
211 | a96ec00f | Constantinos Venetsanopoulos | </Proxy> |
212 | a96ec00f | Constantinos Venetsanopoulos | |
213 | a96ec00f | Constantinos Venetsanopoulos | SetEnv proxy-sendchunked |
214 | a96ec00f | Constantinos Venetsanopoulos | SSLProxyEngine off |
215 | a96ec00f | Constantinos Venetsanopoulos | ProxyErrorOverride off |
216 | a96ec00f | Constantinos Venetsanopoulos | |
217 | a96ec00f | Constantinos Venetsanopoulos | ProxyPass /static ! |
218 | a96ec00f | Constantinos Venetsanopoulos | ProxyPass / http://localhost:8080/ retry=0 |
219 | a96ec00f | Constantinos Venetsanopoulos | ProxyPassReverse / http://localhost:8080/ |
220 | a96ec00f | Constantinos Venetsanopoulos | |
221 | a96ec00f | Constantinos Venetsanopoulos | RewriteEngine On |
222 | a96ec00f | Constantinos Venetsanopoulos | RewriteRule ^/login(.*) /im/login/redirect$1 [PT,NE] |
223 | a96ec00f | Constantinos Venetsanopoulos | |
224 | a96ec00f | Constantinos Venetsanopoulos | SSLEngine on |
225 | a96ec00f | Constantinos Venetsanopoulos | SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem |
226 | a96ec00f | Constantinos Venetsanopoulos | SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key |
227 | a96ec00f | Constantinos Venetsanopoulos | </VirtualHost> |
228 | a96ec00f | Constantinos Venetsanopoulos | </IfModule> |
229 | a96ec00f | Constantinos Venetsanopoulos | |
230 | a96ec00f | Constantinos Venetsanopoulos | Now enable sites and modules by running: |
231 | a96ec00f | Constantinos Venetsanopoulos | |
232 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
233 | a96ec00f | Constantinos Venetsanopoulos | |
234 | a96ec00f | Constantinos Venetsanopoulos | # a2enmod ssl |
235 | a96ec00f | Constantinos Venetsanopoulos | # a2enmod rewrite |
236 | a96ec00f | Constantinos Venetsanopoulos | # a2dissite default |
237 | a96ec00f | Constantinos Venetsanopoulos | # a2ensite synnefo |
238 | a96ec00f | Constantinos Venetsanopoulos | # a2ensite synnefo-ssl |
239 | a96ec00f | Constantinos Venetsanopoulos | # a2enmod headers |
240 | a96ec00f | Constantinos Venetsanopoulos | # a2enmod proxy_http |
241 | a96ec00f | Constantinos Venetsanopoulos | |
242 | a96ec00f | Constantinos Venetsanopoulos | !!! Warning: Do NOT start/restart the server yet. If the server is running: |
243 | a96ec00f | Constantinos Venetsanopoulos | |
244 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
245 | a96ec00f | Constantinos Venetsanopoulos | |
246 | a96ec00f | Constantinos Venetsanopoulos | # /etc/init.d/apache2 stop |
247 | a96ec00f | Constantinos Venetsanopoulos | |
248 | a96ec00f | Constantinos Venetsanopoulos | Pithos+ data directory setup |
249 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
250 | a96ec00f | Constantinos Venetsanopoulos | |
251 | a96ec00f | Constantinos Venetsanopoulos | As mentioned in the General Prerequisites section, there is a directory called |
252 | a96ec00f | Constantinos Venetsanopoulos | ``/srv/pithos`` visible by both nodes. We create and setup the ``data`` |
253 | a96ec00f | Constantinos Venetsanopoulos | directory inside it: |
254 | a96ec00f | Constantinos Venetsanopoulos | |
255 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
256 | a96ec00f | Constantinos Venetsanopoulos | |
257 | a96ec00f | Constantinos Venetsanopoulos | # cd /srv/pithos |
258 | a96ec00f | Constantinos Venetsanopoulos | # mkdir data |
259 | a96ec00f | Constantinos Venetsanopoulos | # chown www-data:www-data data |
260 | a96ec00f | Constantinos Venetsanopoulos | # chmod g+ws data |
261 | a96ec00f | Constantinos Venetsanopoulos | |
262 | a96ec00f | Constantinos Venetsanopoulos | You are now ready with all general prerequisites concerning node1. Let's go to |
263 | a96ec00f | Constantinos Venetsanopoulos | node2. |
264 | a96ec00f | Constantinos Venetsanopoulos | |
265 | a96ec00f | Constantinos Venetsanopoulos | Node2 |
266 | a96ec00f | Constantinos Venetsanopoulos | ----- |
267 | a96ec00f | Constantinos Venetsanopoulos | |
268 | a96ec00f | Constantinos Venetsanopoulos | General Synnefo dependencies |
269 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
270 | a96ec00f | Constantinos Venetsanopoulos | |
271 | a96ec00f | Constantinos Venetsanopoulos | * apache (http server) |
272 | a96ec00f | Constantinos Venetsanopoulos | * gunicorn (WSGI http server) |
273 | a96ec00f | Constantinos Venetsanopoulos | * postgresql (database) |
274 | a96ec00f | Constantinos Venetsanopoulos | * rabbitmq (message queue) |
275 | a96ec00f | Constantinos Venetsanopoulos | |
276 | a96ec00f | Constantinos Venetsanopoulos | You can install the above by running: |
277 | a96ec00f | Constantinos Venetsanopoulos | |
278 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
279 | a96ec00f | Constantinos Venetsanopoulos | |
280 | a96ec00f | Constantinos Venetsanopoulos | # apt-get install apache2 gunicorn postgresql |
281 | a96ec00f | Constantinos Venetsanopoulos | |
282 | a96ec00f | Constantinos Venetsanopoulos | Make sure you have installed the same package versions as in node1. Node2 will |
283 | a96ec00f | Constantinos Venetsanopoulos | connect to the databases on node1, so you will also need the python-psycopg2 |
284 | a96ec00f | Constantinos Venetsanopoulos | package: |
285 | a96ec00f | Constantinos Venetsanopoulos | |
286 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
287 | a96ec00f | Constantinos Venetsanopoulos | |
288 | a96ec00f | Constantinos Venetsanopoulos | # apt-get install python-psycopg2 |
289 | a96ec00f | Constantinos Venetsanopoulos | |
290 | a96ec00f | Constantinos Venetsanopoulos | Database setup |
291 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~ |
292 | a96ec00f | Constantinos Venetsanopoulos | |
293 | a96ec00f | Constantinos Venetsanopoulos | All databases have been created and setup on node1, so we do not need to take |
294 | a96ec00f | Constantinos Venetsanopoulos | any action here. From node2, we will just connect to them. When you get familiar |
295 | a96ec00f | Constantinos Venetsanopoulos | with the software you may choose to run different databases on different nodes, |
296 | a96ec00f | Constantinos Venetsanopoulos | for performance/scalability/redundancy reasons, but those kind of setups are out |
297 | a96ec00f | Constantinos Venetsanopoulos | of the purpose of this guide. |
298 | a96ec00f | Constantinos Venetsanopoulos | |
299 | a96ec00f | Constantinos Venetsanopoulos | Gunicorn setup |
300 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~ |
301 | a96ec00f | Constantinos Venetsanopoulos | |
302 | a96ec00f | Constantinos Venetsanopoulos | Create the file ``synnefo`` under ``/etc/gunicorn.d/`` containing the following |
303 | a96ec00f | Constantinos Venetsanopoulos | (same contents as in node1; you can just copy/paste the file): |
304 | a96ec00f | Constantinos Venetsanopoulos | |
305 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
306 | a96ec00f | Constantinos Venetsanopoulos | |
307 | a96ec00f | Constantinos Venetsanopoulos | CONFIG = { |
308 | a96ec00f | Constantinos Venetsanopoulos | 'mode': 'django', |
309 | a96ec00f | Constantinos Venetsanopoulos | 'environment': { |
310 | a96ec00f | Constantinos Venetsanopoulos | 'DJANGO_SETTINGS_MODULE': 'synnefo.settings', |
311 | a96ec00f | Constantinos Venetsanopoulos | }, |
312 | a96ec00f | Constantinos Venetsanopoulos | 'working_dir': '/etc/synnefo', |
313 | a96ec00f | Constantinos Venetsanopoulos | 'user': 'www-data', |
314 | a96ec00f | Constantinos Venetsanopoulos | 'group': 'www-data', |
315 | a96ec00f | Constantinos Venetsanopoulos | 'args': ( |
316 | a96ec00f | Constantinos Venetsanopoulos | '--bind=127.0.0.1:8080', |
317 | a96ec00f | Constantinos Venetsanopoulos | '--workers=4', |
318 | a96ec00f | Constantinos Venetsanopoulos | '--log-level=debug', |
319 | a96ec00f | Constantinos Venetsanopoulos | ), |
320 | a96ec00f | Constantinos Venetsanopoulos | } |
321 | a96ec00f | Constantinos Venetsanopoulos | |
322 | a96ec00f | Constantinos Venetsanopoulos | !!! Warning: Do NOT start the server yet, because it won't find the |
323 | a96ec00f | Constantinos Venetsanopoulos | ``synnefo.settings`` module. We will start the server after successful |
324 | a96ec00f | Constantinos Venetsanopoulos | installation of astakos. If the server is running: |
325 | a96ec00f | Constantinos Venetsanopoulos | |
326 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
327 | bdb83fd6 | cven | |
328 | a96ec00f | Constantinos Venetsanopoulos | # /etc/init.d/gunicorn stop |
329 | bdb83fd6 | cven | |
330 | a96ec00f | Constantinos Venetsanopoulos | Apache2 setup |
331 | a96ec00f | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~ |
332 | 5b6feb88 | Vangelis Koukis | |
333 | a96ec00f | Constantinos Venetsanopoulos | Create the file ``synnefo`` under ``/etc/apache2/sites-available/`` containing |
334 | a96ec00f | Constantinos Venetsanopoulos | the following: |
335 | 5b6feb88 | Vangelis Koukis | |
336 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
337 | a96ec00f | Constantinos Venetsanopoulos | |
338 | a96ec00f | Constantinos Venetsanopoulos | <VirtualHost *:80> |
339 | a96ec00f | Constantinos Venetsanopoulos | ServerName node2.example.com |
340 | a96ec00f | Constantinos Venetsanopoulos | |
341 | a96ec00f | Constantinos Venetsanopoulos | RewriteEngine On |
342 | a96ec00f | Constantinos Venetsanopoulos | RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
343 | a96ec00f | Constantinos Venetsanopoulos | </VirtualHost> |
344 | a96ec00f | Constantinos Venetsanopoulos | |
345 | a96ec00f | Constantinos Venetsanopoulos | Create the file ``synnefo-ssl`` under ``/etc/apache2/sites-available/`` |
346 | a96ec00f | Constantinos Venetsanopoulos | containing the following: |
347 | a96ec00f | Constantinos Venetsanopoulos | |
348 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
349 | a96ec00f | Constantinos Venetsanopoulos | |
350 | a96ec00f | Constantinos Venetsanopoulos | <IfModule mod_ssl.c> |
351 | a96ec00f | Constantinos Venetsanopoulos | <VirtualHost _default_:443> |
352 | a96ec00f | Constantinos Venetsanopoulos | ServerName node2.example.com |
353 | a96ec00f | Constantinos Venetsanopoulos | |
354 | a96ec00f | Constantinos Venetsanopoulos | Alias /static "/usr/share/synnefo/static" |
355 | a96ec00f | Constantinos Venetsanopoulos | |
356 | a96ec00f | Constantinos Venetsanopoulos | SetEnv no-gzip |
357 | a96ec00f | Constantinos Venetsanopoulos | SetEnv dont-vary |
358 | a96ec00f | Constantinos Venetsanopoulos | |
359 | a96ec00f | Constantinos Venetsanopoulos | RequestHeader set X-Forwarded-Protocol "https" |
360 | a96ec00f | Constantinos Venetsanopoulos | |
361 | a96ec00f | Constantinos Venetsanopoulos | <Proxy * > |
362 | a96ec00f | Constantinos Venetsanopoulos | Order allow,deny |
363 | a96ec00f | Constantinos Venetsanopoulos | Allow from all |
364 | a96ec00f | Constantinos Venetsanopoulos | </Proxy> |
365 | a96ec00f | Constantinos Venetsanopoulos | |
366 | a96ec00f | Constantinos Venetsanopoulos | SetEnv proxy-sendchunked |
367 | a96ec00f | Constantinos Venetsanopoulos | SSLProxyEngine off |
368 | a96ec00f | Constantinos Venetsanopoulos | ProxyErrorOverride off |
369 | a96ec00f | Constantinos Venetsanopoulos | |
370 | a96ec00f | Constantinos Venetsanopoulos | ProxyPass /static ! |
371 | a96ec00f | Constantinos Venetsanopoulos | ProxyPass / http://localhost:8080/ retry=0 |
372 | a96ec00f | Constantinos Venetsanopoulos | ProxyPassReverse / http://localhost:8080/ |
373 | a96ec00f | Constantinos Venetsanopoulos | |
374 | a96ec00f | Constantinos Venetsanopoulos | SSLEngine on |
375 | a96ec00f | Constantinos Venetsanopoulos | SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem |
376 | a96ec00f | Constantinos Venetsanopoulos | SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key |
377 | a96ec00f | Constantinos Venetsanopoulos | </VirtualHost> |
378 | a96ec00f | Constantinos Venetsanopoulos | </IfModule> |
379 | a96ec00f | Constantinos Venetsanopoulos | |
380 | a96ec00f | Constantinos Venetsanopoulos | As in node1, enable sites and modules by running: |
381 | a96ec00f | Constantinos Venetsanopoulos | |
382 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
383 | a96ec00f | Constantinos Venetsanopoulos | |
384 | a96ec00f | Constantinos Venetsanopoulos | # a2enmod ssl |
385 | a96ec00f | Constantinos Venetsanopoulos | # a2enmod rewrite |
386 | a96ec00f | Constantinos Venetsanopoulos | # a2dissite default |
387 | a96ec00f | Constantinos Venetsanopoulos | # a2ensite synnefo |
388 | a96ec00f | Constantinos Venetsanopoulos | # a2ensite synnefo-ssl |
389 | a96ec00f | Constantinos Venetsanopoulos | # a2enmod headers |
390 | a96ec00f | Constantinos Venetsanopoulos | # a2enmod proxy_http |
391 | a96ec00f | Constantinos Venetsanopoulos | |
392 | a96ec00f | Constantinos Venetsanopoulos | !!! Warning: Do NOT start/restart the server yet. If the server is running: |
393 | a96ec00f | Constantinos Venetsanopoulos | |
394 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
395 | a96ec00f | Constantinos Venetsanopoulos | |
396 | a96ec00f | Constantinos Venetsanopoulos | # /etc/init.d/apache2 stop |
397 | a96ec00f | Constantinos Venetsanopoulos | |
398 | a96ec00f | Constantinos Venetsanopoulos | We are now ready with all general prerequisites for node2. Now that we have |
399 | a96ec00f | Constantinos Venetsanopoulos | finished with all general prerequisites for both nodes, we can start installing |
400 | a96ec00f | Constantinos Venetsanopoulos | the services. First, let's install Astakos on node1. |
401 | a96ec00f | Constantinos Venetsanopoulos | |
402 | a96ec00f | Constantinos Venetsanopoulos | |
403 | a96ec00f | Constantinos Venetsanopoulos | Installation of Astakos on node1 |
404 | a96ec00f | Constantinos Venetsanopoulos | ================================ |
405 | a96ec00f | Constantinos Venetsanopoulos | |
406 | a96ec00f | Constantinos Venetsanopoulos | To install astakos, grab the package from our repository (make sure you made |
407 | a96ec00f | Constantinos Venetsanopoulos | the additions needed in your ``/etc/apt/sources.list`` file, as described |
408 | a96ec00f | Constantinos Venetsanopoulos | previously), by running: |
409 | a96ec00f | Constantinos Venetsanopoulos | |
410 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
411 | a96ec00f | Constantinos Venetsanopoulos | |
412 | a96ec00f | Constantinos Venetsanopoulos | # apt-get install snf-astakos-app |
413 | a96ec00f | Constantinos Venetsanopoulos | |
414 | a96ec00f | Constantinos Venetsanopoulos | After successful installation of snf-astakos-app, make sure that also |
415 | a96ec00f | Constantinos Venetsanopoulos | snf-webproject has been installed (marked as "Recommended" package). By default |
416 | a96ec00f | Constantinos Venetsanopoulos | Debian installs "Recommended" packages, but if you have changed your |
417 | a96ec00f | Constantinos Venetsanopoulos | configuration and the package didn't install automatically, you should |
418 | a96ec00f | Constantinos Venetsanopoulos | explicitly install it manually running: |
419 | a96ec00f | Constantinos Venetsanopoulos | |
420 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
421 | a96ec00f | Constantinos Venetsanopoulos | |
422 | a96ec00f | Constantinos Venetsanopoulos | # apt-get install snf-webproject |
423 | a96ec00f | Constantinos Venetsanopoulos | |
424 | a96ec00f | Constantinos Venetsanopoulos | The reason snf-webproject is "Recommended" and not a hard dependency, is to give |
425 | a96ec00f | Constantinos Venetsanopoulos | the experienced administrator the ability to install synnefo in a custom made |
426 | a96ec00f | Constantinos Venetsanopoulos | django project. This corner case concerns only very advanced users that know |
427 | a96ec00f | Constantinos Venetsanopoulos | what they are doing and want to experiment with synnefo. |
428 | a96ec00f | Constantinos Venetsanopoulos | |
429 | a96ec00f | Constantinos Venetsanopoulos | |
430 | a96ec00f | Constantinos Venetsanopoulos | Configuration of Astakos |
431 | a96ec00f | Constantinos Venetsanopoulos | ======================== |
432 | a96ec00f | Constantinos Venetsanopoulos | |
433 | a96ec00f | Constantinos Venetsanopoulos | Conf Files |
434 | a96ec00f | Constantinos Venetsanopoulos | ---------- |
435 | a96ec00f | Constantinos Venetsanopoulos | |
436 | a96ec00f | Constantinos Venetsanopoulos | After astakos is successfully installed, you will find the directory |
437 | a96ec00f | Constantinos Venetsanopoulos | ``/etc/synnefo`` and some configuration files inside it. The files contain |
438 | a96ec00f | Constantinos Venetsanopoulos | commented configuration options, which are the default options. While installing |
439 | a96ec00f | Constantinos Venetsanopoulos | new snf-* components, new configuration files will appear inside the directory. |
440 | a96ec00f | Constantinos Venetsanopoulos | In this guide (and for all services), we will edit only the minimum necessary |
441 | a96ec00f | Constantinos Venetsanopoulos | configuration options, to reflect our setup. Everything else will remain as is. |
442 | a96ec00f | Constantinos Venetsanopoulos | |
443 | a96ec00f | Constantinos Venetsanopoulos | After getting familiar with synnefo, you will be able to customize the software |
444 | a96ec00f | Constantinos Venetsanopoulos | as you wish and fits your needs. Many options are available, to empower the |
445 | a96ec00f | Constantinos Venetsanopoulos | administrator with extensively customizable setups. |
446 | a96ec00f | Constantinos Venetsanopoulos | |
447 | a96ec00f | Constantinos Venetsanopoulos | For the snf-webproject component (installed as an astakos dependency), we |
448 | a96ec00f | Constantinos Venetsanopoulos | need the following: |
449 | a96ec00f | Constantinos Venetsanopoulos | |
450 | a96ec00f | Constantinos Venetsanopoulos | Edit ``/etc/synnefo/10-snf-webproject-database.conf``. You will need to |
451 | a96ec00f | Constantinos Venetsanopoulos | uncomment and edit the ``DATABASES`` block to reflect our database: |
452 | a96ec00f | Constantinos Venetsanopoulos | |
453 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
454 | a96ec00f | Constantinos Venetsanopoulos | |
455 | a96ec00f | Constantinos Venetsanopoulos | DATABASES = { |
456 | a96ec00f | Constantinos Venetsanopoulos | 'default': { |
457 | a96ec00f | Constantinos Venetsanopoulos | # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle' |
458 | a96ec00f | Constantinos Venetsanopoulos | 'ENGINE': 'postgresql_psycopg2', |
459 | a96ec00f | Constantinos Venetsanopoulos | # ATTENTION: This *must* be the absolute path if using sqlite3. |
460 | a96ec00f | Constantinos Venetsanopoulos | # See: http://docs.djangoproject.com/en/dev/ref/settings/#name |
461 | a96ec00f | Constantinos Venetsanopoulos | 'NAME': 'snf_apps', |
462 | a96ec00f | Constantinos Venetsanopoulos | 'USER': 'synnefo', # Not used with sqlite3. |
463 | a96ec00f | Constantinos Venetsanopoulos | 'PASSWORD': 'examle_passw0rd', # Not used with sqlite3. |
464 | a96ec00f | Constantinos Venetsanopoulos | # Set to empty string for localhost. Not used with sqlite3. |
465 | a96ec00f | Constantinos Venetsanopoulos | 'HOST': '4.3.2.1', |
466 | a96ec00f | Constantinos Venetsanopoulos | # Set to empty string for default. Not used with sqlite3. |
467 | a96ec00f | Constantinos Venetsanopoulos | 'PORT': '5432', |
468 | a96ec00f | Constantinos Venetsanopoulos | } |
469 | a96ec00f | Constantinos Venetsanopoulos | } |
470 | a96ec00f | Constantinos Venetsanopoulos | |
471 | a96ec00f | Constantinos Venetsanopoulos | Edit ``/etc/synnefo/10-snf-webproject-deploy.conf``. Uncomment and edit |
472 | a96ec00f | Constantinos Venetsanopoulos | ``SECRET_KEY``. This is a django specific setting which is used to provide a |
473 | a96ec00f | Constantinos Venetsanopoulos | seed in secret-key hashing algorithms. Set this to a random string of your |
474 | a96ec00f | Constantinos Venetsanopoulos | choise and keep it private: |
475 | a96ec00f | Constantinos Venetsanopoulos | |
476 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
477 | a96ec00f | Constantinos Venetsanopoulos | |
478 | a96ec00f | Constantinos Venetsanopoulos | SECRET_KEY = 'sy6)mw6a7x%n)-example_secret_key#zzk4jo6f2=uqu!1o%)' |
479 | a96ec00f | Constantinos Venetsanopoulos | |
480 | a96ec00f | Constantinos Venetsanopoulos | For astakos specific configuration, edit the following options in |
481 | a96ec00f | Constantinos Venetsanopoulos | ``/etc/synnefo/20-snf-astakos-setting.conf`` : |
482 | a96ec00f | Constantinos Venetsanopoulos | |
483 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
484 | a96ec00f | Constantinos Venetsanopoulos | |
485 | a96ec00f | Constantinos Venetsanopoulos | ASTAKOS_IM_MODULES = ['local'] |
486 | a96ec00f | Constantinos Venetsanopoulos | |
487 | a96ec00f | Constantinos Venetsanopoulos | ASTAKOS_COOKIE_DOMAIN = '.example.com' |
488 | a96ec00f | Constantinos Venetsanopoulos | |
489 | a96ec00f | Constantinos Venetsanopoulos | ASTAKOS_BASEURL = 'https://node1.example.com' |
490 | a96ec00f | Constantinos Venetsanopoulos | |
491 | a96ec00f | Constantinos Venetsanopoulos | ASTAKOS_SITENAME = '~okeanos demo example' |
492 | a96ec00f | Constantinos Venetsanopoulos | |
493 | a96ec00f | Constantinos Venetsanopoulos | ASTAKOS_CLOUD_SERVICES = ( |
494 | a96ec00f | Constantinos Venetsanopoulos | { 'url':'https://node1.example.com/im/', 'name':'~okeanos home', 'id':'cloud', 'icon':'home-icon.png' }, |
495 | a96ec00f | Constantinos Venetsanopoulos | { 'url':'https://node1.example.com/ui/', 'name':'cyclades', 'id':'cyclades' }, |
496 | a96ec00f | Constantinos Venetsanopoulos | { 'url':'https://node2.example.com/ui/', 'name':'pithos+', 'id':'pithos' }) |
497 | a96ec00f | Constantinos Venetsanopoulos | |
498 | a96ec00f | Constantinos Venetsanopoulos | ASTAKOS_RECAPTCHA_PUBLIC_KEY = 'example_recaptcha_public_key!@#$%^&*(' |
499 | a96ec00f | Constantinos Venetsanopoulos | ASTAKOS_RECAPTCHA_PRIVATE_KEY = 'example_recaptcha_private_key!@#$%^&*(' |
500 | 5b6feb88 | Vangelis Koukis | |
501 | a96ec00f | Constantinos Venetsanopoulos | ASTAKOS_RECAPTCHA_USE_SSL = True |
502 | 5b6feb88 | Vangelis Koukis | |
503 | a96ec00f | Constantinos Venetsanopoulos | ``ASTAKOS_IM_MODULES`` refers to the astakos login methods. For now only local |
504 | a96ec00f | Constantinos Venetsanopoulos | is supported. The ``ASTAKOS_COOKIE_DOMAIN`` should be the base url of our |
505 | a96ec00f | Constantinos Venetsanopoulos | domain (for all services). ``ASTAKOS_BASEURL`` is the astakos home page. |
506 | a96ec00f | Constantinos Venetsanopoulos | ``ASTAKOS_CLOUD_SERVICES`` contains all services visible to and served by |
507 | a96ec00f | Constantinos Venetsanopoulos | astakos. The first element of the dictionary is used to point to a generic |
508 | a96ec00f | Constantinos Venetsanopoulos | landing page for your services (cyclades, pithos). If you don't have such a |
509 | a96ec00f | Constantinos Venetsanopoulos | page it can be omitted. The second and third element point to our services |
510 | a96ec00f | Constantinos Venetsanopoulos | themselves (the apps) and should be set as above. |
511 | 5b6feb88 | Vangelis Koukis | |
512 | a96ec00f | Constantinos Venetsanopoulos | For the ``ASTAKOS_RECAPTCHA_PUBLIC_KEY`` and ``ASTAKOS_RECAPTCHA_PRIVATE_KEY`` |
513 | a96ec00f | Constantinos Venetsanopoulos | go to https://www.google.com/recaptcha/admin/create and create your own pair. |
514 | 5b6feb88 | Vangelis Koukis | |
515 | a96ec00f | Constantinos Venetsanopoulos | Servers Initialization |
516 | a96ec00f | Constantinos Venetsanopoulos | ---------------------- |
517 | 5b6feb88 | Vangelis Koukis | |
518 | a96ec00f | Constantinos Venetsanopoulos | After configuration is done, we initialize the servers on node1: |
519 | 5b6feb88 | Vangelis Koukis | |
520 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
521 | a96ec00f | Constantinos Venetsanopoulos | |
522 | a96ec00f | Constantinos Venetsanopoulos | root@node1:~ # /etc/init.d/gunicorn restart |
523 | a96ec00f | Constantinos Venetsanopoulos | root@node1:~ # /etc/init.d/apache2 restart |
524 | a96ec00f | Constantinos Venetsanopoulos | |
525 | a96ec00f | Constantinos Venetsanopoulos | Database Initialization |
526 | a96ec00f | Constantinos Venetsanopoulos | ----------------------- |
527 | a96ec00f | Constantinos Venetsanopoulos | |
528 | a96ec00f | Constantinos Venetsanopoulos | Then, we initialize the database by running: |
529 | 5b6feb88 | Vangelis Koukis | |
530 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
531 | a96ec00f | Constantinos Venetsanopoulos | |
532 | a96ec00f | Constantinos Venetsanopoulos | # snf-manage syncdb |
533 | a96ec00f | Constantinos Venetsanopoulos | |
534 | a96ec00f | Constantinos Venetsanopoulos | At this example we don't need to create a django superuser, so we select |
535 | a96ec00f | Constantinos Venetsanopoulos | ``[no]`` to the question. After a successful sync, we run the migration needed |
536 | a96ec00f | Constantinos Venetsanopoulos | for astakos: |
537 | 5b6feb88 | Vangelis Koukis | |
538 | 5b6feb88 | Vangelis Koukis | .. code-block:: console |
539 | 5b6feb88 | Vangelis Koukis | |
540 | a96ec00f | Constantinos Venetsanopoulos | # snf-manage migrate im |
541 | a96ec00f | Constantinos Venetsanopoulos | |
542 | a96ec00f | Constantinos Venetsanopoulos | You have now finished the Astakos setup. Let's test it now. |
543 | a96ec00f | Constantinos Venetsanopoulos | |
544 | a96ec00f | Constantinos Venetsanopoulos | |
545 | a96ec00f | Constantinos Venetsanopoulos | Testing of Astakos |
546 | a96ec00f | Constantinos Venetsanopoulos | ================== |
547 | a96ec00f | Constantinos Venetsanopoulos | |
548 | a96ec00f | Constantinos Venetsanopoulos | Open your favorite browser and go to: |
549 | a96ec00f | Constantinos Venetsanopoulos | |
550 | a96ec00f | Constantinos Venetsanopoulos | ``http://node1.example.com/im`` |
551 | a96ec00f | Constantinos Venetsanopoulos | |
552 | a96ec00f | Constantinos Venetsanopoulos | If this redirects you to ``https://node1.example.com/im`` and you can see |
553 | a96ec00f | Constantinos Venetsanopoulos | the "welcome" door of Astakos, then you have successfully setup Astakos. |
554 | a96ec00f | Constantinos Venetsanopoulos | |
555 | a96ec00f | Constantinos Venetsanopoulos | Let's create our first user. At the homepage click the "CREATE ACCOUNT" button |
556 | a96ec00f | Constantinos Venetsanopoulos | and fill all your data at the sign up form. Then click "SUBMIT". You should now |
557 | a96ec00f | Constantinos Venetsanopoulos | see a green box on the top, which informs you that you made a successful request |
558 | a96ec00f | Constantinos Venetsanopoulos | and the request has been sent to the administrators. So far so good. |
559 | a96ec00f | Constantinos Venetsanopoulos | |
560 | a96ec00f | Constantinos Venetsanopoulos | Now we need to activate that user. Return to a command prompt at node1 and run: |
561 | a96ec00f | Constantinos Venetsanopoulos | |
562 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
563 | a96ec00f | Constantinos Venetsanopoulos | |
564 | a96ec00f | Constantinos Venetsanopoulos | root@node1:~ # snf-manage listusers |
565 | a96ec00f | Constantinos Venetsanopoulos | |
566 | a96ec00f | Constantinos Venetsanopoulos | This command should show you a list with only one user; the one we just created. |
567 | a96ec00f | Constantinos Venetsanopoulos | This user should have an id with a value of ``1``. It should also have an |
568 | a96ec00f | Constantinos Venetsanopoulos | "active" status with the value of ``0`` (inactive). Now run: |
569 | a96ec00f | Constantinos Venetsanopoulos | |
570 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
571 | a96ec00f | Constantinos Venetsanopoulos | |
572 | a96ec00f | Constantinos Venetsanopoulos | root@node1:~ # snf-manage modifyuser --set-active 1 |
573 | a96ec00f | Constantinos Venetsanopoulos | |
574 | a96ec00f | Constantinos Venetsanopoulos | This modifies the active value to ``1``, and actually activates the user. |
575 | a96ec00f | Constantinos Venetsanopoulos | When running in production, the activation is done automatically with different |
576 | a96ec00f | Constantinos Venetsanopoulos | types of moderation, that Astakos supports. You can see the moderation methods |
577 | a96ec00f | Constantinos Venetsanopoulos | (by invitation, whitelists, matching regexp, etc.) at the Astakos specific |
578 | a96ec00f | Constantinos Venetsanopoulos | documentation. |
579 | a96ec00f | Constantinos Venetsanopoulos | |
580 | a96ec00f | Constantinos Venetsanopoulos | Now let's go back to the homepage. Open ``http://node1.example.com/im`` with |
581 | a96ec00f | Constantinos Venetsanopoulos | your browser again. Try to sign in using your new credentials. If the astakos |
582 | a96ec00f | Constantinos Venetsanopoulos | menu appears and you can see your profile, then you have successfully setup |
583 | a96ec00f | Constantinos Venetsanopoulos | Astakos. |
584 | a96ec00f | Constantinos Venetsanopoulos | |
585 | a96ec00f | Constantinos Venetsanopoulos | Let's continue to install Pithos+ now. |
586 | a96ec00f | Constantinos Venetsanopoulos | |
587 | a96ec00f | Constantinos Venetsanopoulos | |
588 | a96ec00f | Constantinos Venetsanopoulos | Installation of Pithos+ on node2 |
589 | a96ec00f | Constantinos Venetsanopoulos | ================================ |
590 | a96ec00f | Constantinos Venetsanopoulos | |
591 | a96ec00f | Constantinos Venetsanopoulos | To install pithos+, grab the package from our repository (make sure you made |
592 | a96ec00f | Constantinos Venetsanopoulos | the additions needed in your ``/etc/apt/sources.list`` file, as described |
593 | a96ec00f | Constantinos Venetsanopoulos | previously), by running: |
594 | a96ec00f | Constantinos Venetsanopoulos | |
595 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
596 | a96ec00f | Constantinos Venetsanopoulos | |
597 | a96ec00f | Constantinos Venetsanopoulos | # apt-get install snf-pithos-app |
598 | a96ec00f | Constantinos Venetsanopoulos | |
599 | a96ec00f | Constantinos Venetsanopoulos | After successful installation of snf-pithos-app, make sure that also |
600 | a96ec00f | Constantinos Venetsanopoulos | snf-webproject has been installed (marked as "Recommended" package). Refer to |
601 | a96ec00f | Constantinos Venetsanopoulos | the "Installation of Astakos on node1" section, if you don't remember why this |
602 | a96ec00f | Constantinos Venetsanopoulos | should happen. |
603 | a96ec00f | Constantinos Venetsanopoulos | |
604 | a96ec00f | Constantinos Venetsanopoulos | |
605 | a96ec00f | Constantinos Venetsanopoulos | Configuration of Pithos+ |
606 | a96ec00f | Constantinos Venetsanopoulos | ======================== |
607 | a96ec00f | Constantinos Venetsanopoulos | |
608 | a96ec00f | Constantinos Venetsanopoulos | Conf Files |
609 | a96ec00f | Constantinos Venetsanopoulos | ---------- |
610 | a96ec00f | Constantinos Venetsanopoulos | |
611 | a96ec00f | Constantinos Venetsanopoulos | After pithos+ is successfully installed, you will find the directory |
612 | a96ec00f | Constantinos Venetsanopoulos | ``/etc/synnefo`` and some configuration files inside it, as you did in node1 |
613 | a96ec00f | Constantinos Venetsanopoulos | after installation of astakos. Here, you will not have to change anything that |
614 | a96ec00f | Constantinos Venetsanopoulos | has to do with snf-common or snf-webproject. Everything is set at node1. You |
615 | a96ec00f | Constantinos Venetsanopoulos | only need to change settings that have to do with pithos. Specifically: |
616 | a96ec00f | Constantinos Venetsanopoulos | |
617 | a96ec00f | Constantinos Venetsanopoulos | Edit ``/etc/synnefo/20-snf-pithos-app-settings.conf``. There you need to set |
618 | a96ec00f | Constantinos Venetsanopoulos | only the two options: |
619 | a96ec00f | Constantinos Venetsanopoulos | |
620 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
621 | a96ec00f | Constantinos Venetsanopoulos | |
622 | a96ec00f | Constantinos Venetsanopoulos | PITHOS_BACKEND_DB_CONNECTION = 'postgresql://synnefo:example_passw0rd@node1.example.com:5432/snf_pithos' |
623 | a96ec00f | Constantinos Venetsanopoulos | |
624 | a96ec00f | Constantinos Venetsanopoulos | PITHOS_BACKEND_BLOCK_PATH = '/srv/pithos/data' |
625 | a96ec00f | Constantinos Venetsanopoulos | |
626 | a96ec00f | Constantinos Venetsanopoulos | The ``PITHOS_BACKEND_DB_CONNECTION`` option tells to the pithos+ backend where |
627 | a96ec00f | Constantinos Venetsanopoulos | to find its database. Above we tell pithos+ that its database is ``snf_pithos`` |
628 | a96ec00f | Constantinos Venetsanopoulos | at node1 and to connect as user ``synnefo`` with password ``example_passw0rd``. |
629 | a96ec00f | Constantinos Venetsanopoulos | All those settings where setup during node1's "Database setup" section. |
630 | a96ec00f | Constantinos Venetsanopoulos | |
631 | a96ec00f | Constantinos Venetsanopoulos | The ``PITHOS_BACKEND_BLOCK_PATH`` option tells to the pithos+ backend where to |
632 | a96ec00f | Constantinos Venetsanopoulos | store its data. Above we tell pithos+ to store its data under |
633 | a96ec00f | Constantinos Venetsanopoulos | ``/srv/pithos/data``, which is visible by both nodes. We have already setup this |
634 | a96ec00f | Constantinos Venetsanopoulos | directory at node1's "Pithos+ data directory setup" section. |
635 | a96ec00f | Constantinos Venetsanopoulos | |
636 | a96ec00f | Constantinos Venetsanopoulos | Servers Initialization |
637 | a96ec00f | Constantinos Venetsanopoulos | ---------------------- |
638 | a96ec00f | Constantinos Venetsanopoulos | |
639 | a96ec00f | Constantinos Venetsanopoulos | After configuration is done, we initialize the servers on node2: |
640 | a96ec00f | Constantinos Venetsanopoulos | |
641 | a96ec00f | Constantinos Venetsanopoulos | .. code-block:: console |
642 | a96ec00f | Constantinos Venetsanopoulos | |
643 | a96ec00f | Constantinos Venetsanopoulos | root@node2:~ # /etc/init.d/gunicorn restart |
644 | a96ec00f | Constantinos Venetsanopoulos | root@node2:~ # /etc/init.d/apache2 restart |
645 | a96ec00f | Constantinos Venetsanopoulos | |
646 | a96ec00f | Constantinos Venetsanopoulos | |
647 | a96ec00f | Constantinos Venetsanopoulos | You have now finished the Pithos+ setup. Let's test it now. |
648 | a96ec00f | Constantinos Venetsanopoulos | |
649 | a96ec00f | Constantinos Venetsanopoulos | |
650 | a96ec00f | Constantinos Venetsanopoulos | Testing of Pithos+ |
651 | a96ec00f | Constantinos Venetsanopoulos | ================== |
652 | a96ec00f | Constantinos Venetsanopoulos | |
653 | a96ec00f | Constantinos Venetsanopoulos | |
654 | a96ec00f | Constantinos Venetsanopoulos | Installation of Cyclades (and Plankton) on node1 |
655 | a96ec00f | Constantinos Venetsanopoulos | ================================================ |
656 | a96ec00f | Constantinos Venetsanopoulos | |
657 | a96ec00f | Constantinos Venetsanopoulos | |
658 | a96ec00f | Constantinos Venetsanopoulos | Configuration of Cyclades (and Plankton) |
659 | a96ec00f | Constantinos Venetsanopoulos | ======================================== |
660 | 5b6feb88 | Vangelis Koukis | |
661 | 5b6feb88 | Vangelis Koukis | |
662 | a96ec00f | Constantinos Venetsanopoulos | Testing of Cyclades (and Plankton) |
663 | a96ec00f | Constantinos Venetsanopoulos | ================================== |
664 | 5b6feb88 | Vangelis Koukis | |
665 | 5b6feb88 | Vangelis Koukis | |
666 | a96ec00f | Constantinos Venetsanopoulos | General Testing |
667 | a96ec00f | Constantinos Venetsanopoulos | =============== |
668 | 5b6feb88 | Vangelis Koukis | |
669 | 5b6feb88 | Vangelis Koukis | |
670 | a96ec00f | Constantinos Venetsanopoulos | Notes |
671 | a96ec00f | Constantinos Venetsanopoulos | ===== |