Documentation has been split into multiple files for more readability.

This commit is contained in:
Antoine Nguyen
2012-06-27 15:02:55 +02:00
parent 53a6faebd1
commit 86538ac1df
19 changed files with 1420 additions and 1343 deletions
+67
View File
@@ -0,0 +1,67 @@
#############################
Migrating from other software
#############################
************
PostfixAdmin
************
Since version 0.8.5, Modoboa provides a simple script to migrate an
existing `PostfixAdmin (version 2.3.3+)
<http://postfixadmin.sourceforge.net/>`_ database to a Modoboa one.
.. note::
This script is only suitable for a new installation.
First, you must follow the :ref:`installation` step to create a fresh
Modoboa database.
Once done, edit the *setting.py* file. First, add a new database
connection named ``pfxadmin`` into the ``DATABASES`` variable
corresponding to your PostfixAdmin setup::
DATABASES = {
"default" : {
# default connection definition
},
"pfxadmin" : {
"ENGINE" : "<engine>",
"NAME" : "<database name>",
"USER" : "<database user>",
"PASSWORD" : "<user password>",
}
}
This connection should correspond to the one defined in PostfixAdmin's
configuration file.
You are now ready to start the migration. Enter Modoboa's root
directory and execute the following command::
$ PYTHONPATH=$PWD/.. DJANGO_SETTINGS_MODULE=modoboa.settings \
./tools/pfxadmin_migrate/migrate.py -r -p <directory that stores mailboxes>
Depending on how many domains/mailboxes your existing setup contains,
the migration can be long. Just wait for the script's ending.
Once the migration has succeed, go the *Admin > Configuration* panel,
click on the *admin* row and modify the value of ``MAILDIR_ROOT`` as
follow::
MAILDIR_ROOT =
The corresponding field must be empty. Don't touch other fields except
``PASSWORD_SCHEME``, if needed. (set it to the same method as the one
used by PostfixAdmin, check its configuration file if you're not sure)
Click on the *Save* button.
The procedure is over, edit the *settings.py* file and:
* remove the ``pfxadmin`` database connection from the ``DATABASES``
variable
* remove the ``'modoboa.tools.pfxadmin_migrate',`` from the
``INSTALLED_APPS`` variable
You should be able to connect to Modoboa using the same credentials
you were using to connect to PostfixAdmin.
+87
View File
@@ -0,0 +1,87 @@
Using the virtual machine
*************************
Introduction
============
A virtual machine with a ready-to-use *Modoboa* setup is available
`here <http://modoboa.org/resources/modoboa.vmdk.bz2>`_. It is composed
of the following components:
* Debian 6.0 (squeeze)
* Modoboa and its prerequisites
* MySQL
* Postfix
* Dovecot
* saslauthd
* nginx and gunicorn
Actually, it is the result you obtain if you follow the official
documentation.
The disk image is using the `VMDK
<http://en.wikipedia.org/wiki/VMDK>`_ format and is compressed using
bzip2. To decompress it, just run the following command::
$ bunzip2 modoboa.vmdk.bz2
If you can't use the vmdk format, you can use `qemu
<http://qemu.org/>`_ to convert it to another one. For example::
$ qemu-img convert modoboa.vmdk -O qcow2 modoboa.qcow2
Then, just use your prefered virtualization software (qemu, kvm,
virtualbox, etc.) to start the machine. You'll need to configure at
least one bridged network interface if you want to be able to play
with *Modoboa*, ie. your machine must be visible from your network.
The default network interface of the machine (``eth0``) is configured
to use the DHCP protocol.
Connect to the machine
======================
The following UNIX users are available if you want to connect to the system:
===== ======== ====================
Login Password Description
===== ======== ====================
root demo the root user
demo demo an unpriviliged user
===== ======== ====================
To connect to *Modoboa*, first connect to the system and retrieve its
current network address like this::
$ /sbin/ifconfig eth0
Once you know its address, open a web browser and go to this url::
http://<ip_address>/modoboa/admin/
You should see the login page. Here are the users available by default:
================ ======== ============================================
Login Password Capabitilies
================ ======== ============================================
admin password Default super administrator. Can do anything
on the admin but can't access applications
admin@demo.local admin Administrator of the domain *demo.local*.
Can administrater its domain and access to
applications.
user@demo.local user Simple user. Can access to applications.
================ ======== ============================================
Limitations
===========
Using this demo, you will be able to test almost every functionality
*Modoboa* provides. The exceptions are listed below:
* No spam quarantine: there is not any amavis setup on the machine. By
the way, you can still use this feature if you know any quarantine
available on your network.
+105
View File
@@ -0,0 +1,105 @@
.. _webserver:
#######################################
How to serve Modoboa behind a webserver
#######################################
********
Apache 2
********
First, make sure that both *apache2* and *mod_python* are installed on
your server.
Create a new virtualhost in your Apache configuration and put the
following inside::
<VirtualHost *:80>
<Location "/">
SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonPath "['<path to directory that contains modoboa dir>'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE modoboa.settings
</Location>
Alias "/sitestatic" "<path to modoboa dir>/sitestatic"
<Location "/sitestatic/">
SetHandler None
</Location>
Alias "/media" "<path to modoboa dir>/media"
<Location "/media/">
SetHandler None
</Location>
</VirtualHost>
This is one possible configuration. Note that you will certainly need more
configuration in order to launch Apache.
*****
Nginx
*****
`Nginx <http://nginx.org/>`_ is a really fast HTTP server. Associated
with `Green Unicorn <http://gunicorn.org/>`_, it gives you one of the
best setup to serve python/Django applications. Modoboa's
performances are really good with this configuration.
To use this setup, first download and install those softwares
(`Install gunicorn <http://gunicorn.org/install.html>`_ and `install
nginx <http://wiki.nginx.org/Install>`_).
Then, use the following sample *gunicorn* configuration (create a new
file named *gunicorn.conf.py* inside Modoboa's root dir)::
backlog = 2048
bind = "unix:/var/run/gunicorn/modoboa.sock"
pidfile = "/var/run/gunicorn/modoboa.pid"
daemon = True
debug = False
workers = 2
logfile = "/var/log/gunicorn/modoboa.log"
loglevel = "info"
To start gunicorn, execute the following commands::
$ cd <modoboa dir>
$ gunicorn_django -c gunicorn.conf.py
Now the *nginx* part. Just create a new virtual host and use the
following configuration::
upstream modoboa {
server unix:/var/run/gunicorn/modoboa.sock fail_timeout=0;
}
server {
listen 443;
server_name <host fqdn>;
root <modoboa's root dir>;
access_log /var/log/nginx/<host fqdn>.access.log;
error_log /var/log/nginx/<host fqdn>.error.log;
location /sitestatic/ {
autoindex on;
}
location /media/ {
autoindex on;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Forwarded-Protocol ssl;
if (!-f $request_filename) {
proxy_pass http://modoboa;
break;
}
}
}
Paste this content to your configuration (replace values between
``<>`` with yours), restart *nginx* and enjoy a really fast
application!