зеркало из https://github.com/mozilla/kitsune.git
Production documents.
This commit is contained in:
Родитель
03b9b540b9
Коммит
79847afa23
|
@ -8,6 +8,11 @@ Requirements
|
|||
|
||||
* Python 2.6
|
||||
* `setuptools <http://pypi.python.org/pypi/setuptools#downloads>`_
|
||||
* `Hunspell <http://hunspell.sourceforge.net/>`_ (Specifically, headers for
|
||||
`PyHunspell <http://code.google.com/p/pyhunspell/>`_.)
|
||||
* With Hunspell, you will also need dictionaries, either from Hunspell or
|
||||
MySpell, to provide spelling suggestions on search queries.
|
||||
* Note that Hunspell is required even if no dictionaries are installed.
|
||||
|
||||
|
||||
Additional Requirements
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
from settings import *
|
||||
|
||||
DEBUG=False
|
||||
TEMPLATE_DEBUG=False
|
||||
|
||||
# The default database should point to the master.
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'NAME': 'kitsune',
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'HOST': '',
|
||||
'USER': '',
|
||||
'PASSWORD': '',
|
||||
'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
|
||||
},
|
||||
'slave-1': {
|
||||
'NAME': 'kitsune',
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'HOST': '',
|
||||
'USER': '',
|
||||
'PASSWORD': '',
|
||||
'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
|
||||
},
|
||||
}
|
||||
|
||||
# Put the aliases for slave databases in this list.
|
||||
SLAVE_DATABASES = ['slave-1']
|
||||
|
||||
# Use IP:PORT pairs separated by semicolons.
|
||||
CACHE_BACKEND = 'caching.backends.memcached://localhost:11211;localhost:11212?timeout=500'
|
||||
|
||||
# This is used to hash some things in Django.
|
||||
SECRET_KEY = 'replace me with something long and random'
|
||||
|
||||
LOG_LEVEL = logging.WARNING
|
||||
|
||||
DEBUG_PROPAGATE_EXCEPTIONS = DEBUG
|
|
@ -0,0 +1,74 @@
|
|||
.. _wsgi:
|
||||
|
||||
=============================
|
||||
Running Kitsune with mod_wsgi
|
||||
=============================
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* See ``docs/installation.rst``.
|
||||
* `virtualenv <http://pypi.python.org/pypi/virtualenv>`_
|
||||
* `Apache HTTP server <http://httpd.apache.org/>`_
|
||||
* `mod_wsgi <http://code.google.com/p/modwsgi/>`_
|
||||
* **Not** ``mod_python``! It is incompatible with ``mod_wsgi``.
|
||||
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
Kitsune will require two seperate virtual environments for ``mod_wsgi`` to
|
||||
run correctly. One should be kept empty, and is used to ensure no system
|
||||
packages sneak into the Kitsune virtualenv.
|
||||
|
||||
Kitsune should be cloned into a directory named ``kitsune`` outside of the
|
||||
web root for the server or ``<VirtualHost>``. It will be aliased to the
|
||||
correct location.
|
||||
|
||||
|
||||
WSGI Configuration
|
||||
------------------
|
||||
|
||||
In the Apache config (or ``<VirtualHost>``) you will need the following:
|
||||
|
||||
*Note that values may be slightly different.*
|
||||
|
||||
::
|
||||
|
||||
WSGIPythonHome /path/to/empty/virtualenv
|
||||
WSGISocketPrefix /var/run/wsgi
|
||||
|
||||
WSGIDaemonProcess kitsune processes=8 threads=1 \
|
||||
python-path=/home/james/.virtualenvs/kitsune/lib/python2.6/site-packages
|
||||
WSGIProcessGroup kitsune
|
||||
|
||||
WSGIScriptAlias /k "/path/to/kitsune/wsgi/kitsune.wsgi"
|
||||
|
||||
Alias /media/ "/path/to/kitsune/media/"
|
||||
|
||||
``WSGIPythonHome`` points to an empty, pristine virtual environment.
|
||||
|
||||
``WSGISocketPrefix`` may or may not be necessary. It was for me.
|
||||
|
||||
``WSGIDaemonProcess``: ``processes`` should be set to the number of cores.
|
||||
``threads`` should probably be left at 1. ``python-path`` is set to the
|
||||
``site-packages`` directory of the Kitsune virtual environment.
|
||||
|
||||
``WSGIScriptAlias`` will make Kitsune accessible from ``http://domain/k``,
|
||||
and we use rewrites in ``.htaccess`` to hide the ``/k``. *This may change
|
||||
when we remove the TikiWiki portion of SUMO.*
|
||||
|
||||
The ``Alias`` lets Kitsune access its CSS, JS, and images through Apache,
|
||||
reducing the load on Django.
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
Most of our ``settings.py`` is under version control, but can be overridden
|
||||
in a file called ``settings_local.py`` in the base of the app (the same
|
||||
place as ``settings.py``). You can see example settings in
|
||||
``/docs/settings/settings_local.prod.py``:
|
||||
|
||||
.. literalinclude:: /settings/settings_local.prod.py
|
Загрузка…
Ссылка в новой задаче