root / docs / scale / i-webproject.rst @ 0d1f9117
History | View | Annotate | Download (1.8 kB)
1 |
.. _i-webproject: |
---|---|
2 |
|
3 |
Synnefo |
4 |
------- |
5 |
|
6 |
:ref:`synnefo <i-synnefo>` || |
7 |
:ref:`ns <i-ns>` || |
8 |
:ref:`apt <i-apt>` || |
9 |
:ref:`mq <i-mq>` || |
10 |
:ref:`db <i-db>` || |
11 |
:ref:`gunicorn <i-gunicorn>` || |
12 |
:ref:`apache <i-apache>` || |
13 |
webproject || |
14 |
:ref:`astakos <i-astakos>` || |
15 |
:ref:`cms <i-cms>` || |
16 |
:ref:`pithos <i-pithos>` || |
17 |
:ref:`cyclades <i-cyclades>` || |
18 |
:ref:`kamaki <i-kamaki>` || |
19 |
:ref:`backends <i-backends>` |
20 |
|
21 |
Webproject Setup |
22 |
++++++++++++++++ |
23 |
|
24 |
The following apply to ``astakos``, ``pithos``, ``cyclades`` and ``cms`` nodes. |
25 |
|
26 |
First install: |
27 |
|
28 |
.. code-block:: console |
29 |
|
30 |
# apt-get install python-psycopg2 |
31 |
# apt-get install snf-webproject |
32 |
|
33 |
In `/etc/synnefo/snf-webproject.conf` add: |
34 |
|
35 |
.. code-block:: console |
36 |
|
37 |
from synnefo.lib.db.pooled_psycopg2 import monkey_patch_psycopg2 |
38 |
monkey_patch_psycopg2() |
39 |
|
40 |
from synnefo.lib.db.psyco_gevent import make_psycopg_green |
41 |
make_psycopg_green() |
42 |
|
43 |
DATABASES = { |
44 |
'default': { |
45 |
# 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle' |
46 |
'ENGINE': 'postgresql_psycopg2', |
47 |
'OPTIONS': {'synnefo_poolsize': 8}, |
48 |
# ATTENTION: This *must* be the absolute path if using sqlite3. |
49 |
# See: http://docs.djangoproject.com/en/dev/ref/settings/#name |
50 |
'NAME': 'snf_apps', |
51 |
'USER': 'synnefo', # Not used with sqlite3. |
52 |
'PASSWORD': 'examle_passw0rd', # Not used with sqlite3. |
53 |
# Set to empty string for localhost. Not used with sqlite3. |
54 |
'HOST': 'db.example.com', |
55 |
# Set to empty string for default. Not used with sqlite3. |
56 |
'PORT': '5432', |
57 |
} |
58 |
} |
59 |
|
60 |
USE_X_FORWARDED_HOST = True |
61 |
|
62 |
SECRET_KEY = 'sy6)mw6a7x%n)-example_secret_key#zzk4jo6f2=uqu!1o%)' |
63 |
|
64 |
SESSION_COOKIE_DOMAIN = "example.com" |
65 |
|
66 |
All the above enables pooling (of connections) and greenlet context. |
67 |
|
68 |
|
69 |
Test your Setup: |
70 |
++++++++++++++++ |