Statistics
| Branch: | Tag: | Revision:

root / docs / scale / i-webproject.rst @ 276f454e

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:`qh <i-qh>` ||
16
:ref:`cms <i-cms>` ||
17
:ref:`pithos <i-pithos>` ||
18
:ref:`cyclades <i-cyclades>` ||
19
:ref:`kamaki <i-kamaki>` ||
20
:ref:`backends <i-backends>`
21

    
22
Webproject Setup
23
++++++++++++++++
24

    
25
The following apply to  ``astakos``, ``pithos``, ``cyclades`` and ``cms`` nodes.
26

    
27
First install:
28

    
29
.. code-block:: console
30

    
31
   # apt-get install python-psycopg2
32
   # apt-get install snf-webproject
33

    
34
In `/etc/synnefo/snf-webproject.conf` add:
35

    
36
.. code-block:: console
37

    
38
   from synnefo.lib.db.pooled_psycopg2 import monkey_patch_psycopg2
39
   monkey_patch_psycopg2()
40

    
41
   from synnefo.lib.db.psyco_gevent import make_psycopg_green
42
   make_psycopg_green()
43

    
44
   DATABASES = {
45
    'default': {
46
        # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
47
        'ENGINE': 'postgresql_psycopg2',
48
        'OPTIONS': {'synnefo_poolsize': 8},
49
         # ATTENTION: This *must* be the absolute path if using sqlite3.
50
         # See: http://docs.djangoproject.com/en/dev/ref/settings/#name
51
        'NAME': 'snf_apps',
52
        'USER': 'synnefo',                      # Not used with sqlite3.
53
        'PASSWORD': 'examle_passw0rd',          # Not used with sqlite3.
54
        # Set to empty string for localhost. Not used with sqlite3.
55
        'HOST': 'db.example.com',
56
        # Set to empty string for default. Not used with sqlite3.
57
        'PORT': '5432',
58
    }
59
   }
60

    
61
   USE_X_FORWARDED_HOST = True
62

    
63
   SECRET_KEY = 'sy6)mw6a7x%n)-example_secret_key#zzk4jo6f2=uqu!1o%)'
64

    
65
   SESSION_COOKIE_DOMAIN = "example.com"
66

    
67
All the above enables pooling (of connections) and greenlet context.
68

    
69

    
70
Test your Setup:
71
++++++++++++++++