Merge branch '1.1.x'

This commit is contained in:
Antoine Nguyen
2014-06-06 09:49:48 +02:00
8 changed files with 32 additions and 16 deletions
+18 -14
View File
@@ -107,19 +107,21 @@ Nginx
possible that **your** installation of uwsgi or nginx or Apache or
what-have-you works differently. Keep this in mind.
This section covers two different ways of running Modoboa behind
`Nginx <http://nginx.org/>`_ using a WSGI application server. Choose
the one you prefer between `Green Unicorn <http://gunicorn.org/>`_ or
`uWSGI <https://github.com/unbit/uwsgi>`_.
In both cases, you'll need to download and `install nginx
<http://wiki.nginx.org/Install>`_.
Green Unicorn
=============
`Nginx <http://nginx.org/>`_ is a really fast HTTP server. Associated
with `Green Unicorn <http://gunicorn.org/>`_, it gives you one of the
best setups to serve python/Django applications. Modoboa's
performance is really good with this configuration.
To use this setup, first download and install `nginx
<http://wiki.nginx.org/Install>`__ and `gunicorn
Firstly, `Download and install gunicorn
<http://gunicorn.org/install.html>`_. Then, use the following sample
gunicorn configuration (create a new file named :file:`gunicorn.conf.py`
inside Modoboa's root dir)::
gunicorn configuration (create a new file named
:file:`gunicorn.conf.py` inside Modoboa's root dir)::
backlog = 2048
bind = "unix:/var/run/gunicorn/modoboa.sock"
@@ -191,7 +193,7 @@ Paste this content to your configuration (replace values between
``<>`` with yours), restart nginx and enjoy a really fast
application!
uwsgi
uWSGI
=====
The following setup is meant to get you started quickly. You should
@@ -213,8 +215,7 @@ uwsgi:
Use uwsgi 1.2.6 or newer. If you do not, you *will* run into
problems. Modoboa will fail in obscure ways.
To use this setup, first download and install `nginx
<http://wiki.nginx.org/Install>`__ and `uwsgi
To use this setup, first `download and install uwsgi
<http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html>`_.
Here is a sample nginx configuration::
@@ -256,11 +257,14 @@ Here is a sample nginx configuration::
location <modoba's root url>/ {
include uwsgi_params;
uwsgi_pass <uwsgi port>;
uwsgi_param UWSGI_SCRIPT modoboa_server.wsgi:application
uwsgi_param UWSGI_SCRIPT <modoboa instance name>.wsgi:application
uwsgi_param UWSGI_SCHEME https;
}
}
``<modoboa instance name>`` must be replaced by the value you used
when :ref:`you deployed your instance <deployment>`.
If you do not plan to use SSL then change the listen directive to
``listen 80;`` and delete each of the following directives::
@@ -272,7 +276,7 @@ If you do not plan to use SSL then change the listen directive to
If you do plan to use SSL, you'll have to generate a certificate and a
key. `This article
<http://wiki.nginx.org/HttpSslModule#Generate_Certificates>`__
<http://wiki.nginx.org/HttpSslModule#Generate_Certificates>`_
contains information about how to do it.
Make sure to replace the ``<...>`` in the sample configuration with
@@ -2,6 +2,7 @@
# coding: utf-8
import datetime
from optparse import make_option
from django import db
from django.core.management.base import BaseCommand
from django.utils import timezone
from modoboa.core import load_core_settings
@@ -42,4 +43,5 @@ class Command(BaseCommand):
self.__vprint("Deleting logs older than %d days..." % log_maximum_age)
limit = timezone.now() - datetime.timedelta(log_maximum_age)
Log.objects.filter(date_created__lt=limit).delete()
db.close_connection()
self.__vprint("Done.")
@@ -1,6 +1,7 @@
import os
import logging
from optparse import make_option
from django import db
from django.core.management.base import BaseCommand
from modoboa.lib import parameters
from modoboa.lib.sysutils import exec_cmd
@@ -90,3 +91,4 @@ class Command(BaseCommand):
self.logger.info('%s succeed', ope)
ope.delete()
os.unlink(options['pidfile'])
db.close_connection()
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# coding: utf-8
from optparse import make_option
from django import db
from django.core.management.base import BaseCommand, CommandError
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
@@ -90,3 +91,4 @@ class Command(BaseCommand):
continue
rcpt = su.mailbox_set.all()[0].full_address
self.send_pr_notification(rcpt, reqs)
db.close_connection()
@@ -3,6 +3,7 @@
import time
from optparse import make_option
from django import db
from django.core.management.base import BaseCommand
from modoboa.lib import parameters
from modoboa.extensions.amavis import Amavis
@@ -63,5 +64,6 @@ class Command(BaseCommand):
for maddr in Maddr.objects.all():
if not maddr.msgs_set.count() and not maddr.msgrcpt_set.count():
maddr.delete()
db.close_connection()
self.__vprint("Done.")
@@ -2,6 +2,7 @@
# coding: utf-8
import sys
import datetime
from django import db
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from modoboa.lib import parameters
@@ -64,3 +65,4 @@ class Command(BaseCommand):
continue
send_autoreply(sender, mbox, armessage)
db.close_connection()
@@ -23,8 +23,9 @@ import os
import re
import rrdtool
import string
from django.core.management.base import BaseCommand
from optparse import make_option
from django import db
from django.core.management.base import BaseCommand
from modoboa.lib import parameters
from modoboa.extensions.admin.models import Domain
from modoboa.extensions.stats import Stats
@@ -353,3 +354,4 @@ class Command(BaseCommand):
options["logfile"] = parameters.get_admin("LOGFILE", app="stats")
p = LogParser(options, parameters.get_admin("RRD_ROOTDIR", app="stats"))
p.process()
db.close_connection()
+1 -1
View File
@@ -1,5 +1,5 @@
django>=1.5,<1.6
django-reversion>=1.8.0
django-reversion==1.8.0
dj-database-url
south
lxml