diff --git a/docs/.build/doctrees/en/apache_install.doctree b/docs/.build/doctrees/en/apache_install.doctree index 8b08b5a..a74c9e5 100644 Binary files a/docs/.build/doctrees/en/apache_install.doctree and b/docs/.build/doctrees/en/apache_install.doctree differ diff --git a/docs/.build/doctrees/en/nginx_install.doctree b/docs/.build/doctrees/en/nginx_install.doctree index 3a15c8c..fb54ffe 100644 Binary files a/docs/.build/doctrees/en/nginx_install.doctree and b/docs/.build/doctrees/en/nginx_install.doctree differ diff --git a/docs/.build/doctrees/en/options.doctree b/docs/.build/doctrees/en/options.doctree index 050edf9..24f9036 100644 Binary files a/docs/.build/doctrees/en/options.doctree and b/docs/.build/doctrees/en/options.doctree differ diff --git a/docs/.build/doctrees/en/theming.doctree b/docs/.build/doctrees/en/theming.doctree index e422380..1a07af0 100644 Binary files a/docs/.build/doctrees/en/theming.doctree and b/docs/.build/doctrees/en/theming.doctree differ diff --git a/docs/.build/doctrees/en/using_supervisor.doctree b/docs/.build/doctrees/en/using_supervisor.doctree index d1f95ce..bb91669 100644 Binary files a/docs/.build/doctrees/en/using_supervisor.doctree and b/docs/.build/doctrees/en/using_supervisor.doctree differ diff --git a/docs/.build/doctrees/environment.pickle b/docs/.build/doctrees/environment.pickle index 8d1f4f9..0e71914 100644 Binary files a/docs/.build/doctrees/environment.pickle and b/docs/.build/doctrees/environment.pickle differ diff --git a/docs/.build/doctrees/fr/apache_install.doctree b/docs/.build/doctrees/fr/apache_install.doctree index fb1e0c6..acd300d 100644 Binary files a/docs/.build/doctrees/fr/apache_install.doctree and b/docs/.build/doctrees/fr/apache_install.doctree differ diff --git a/docs/.build/doctrees/fr/nginx_install.doctree b/docs/.build/doctrees/fr/nginx_install.doctree index cb2c25c..162511d 100644 Binary files a/docs/.build/doctrees/fr/nginx_install.doctree and b/docs/.build/doctrees/fr/nginx_install.doctree differ diff --git a/docs/.build/doctrees/fr/using_supervisor.doctree b/docs/.build/doctrees/fr/using_supervisor.doctree index 7206ada..8ab6de7 100644 Binary files a/docs/.build/doctrees/fr/using_supervisor.doctree and b/docs/.build/doctrees/fr/using_supervisor.doctree differ diff --git a/docs/.build/doctrees/index.doctree b/docs/.build/doctrees/index.doctree index 3c9ee5a..5319ae7 100644 Binary files a/docs/.build/doctrees/index.doctree and b/docs/.build/doctrees/index.doctree differ diff --git a/docs/.build/html/_sources/en/apache_install.txt b/docs/.build/html/_sources/en/apache_install.txt index 4f47153..99f942c 100644 --- a/docs/.build/html/_sources/en/apache_install.txt +++ b/docs/.build/html/_sources/en/apache_install.txt @@ -2,8 +2,7 @@ Apache setup ============= -Apache is slower, heavier and more complicated to setup than Nginx. But it's also -much more famous: +Apache is heavier than Nginx. But it's also much more famous: - more people will be able to help you on forums; - your hosting will most probably support Apache; @@ -33,7 +32,65 @@ the setup of the Apache module mod_wsgi. If you don't know how to do this, or if you can't do it (E.G: your hosting won't let you), you need to go for the CGI setup. -========== +First, make sure you have mod_wsgi installed and enable by running (as admin):: -This setup is considered as slow, but you will still benefit from Apache -robustness. \ No newline at end of file + a2enmod wsgi + +This enable mod_wsgi. It it doesn't, install it first (on ubuntu, the package +is libapache2-mod-wsgi). + +Then create an Apache configuration file, usually in /etc/apache/sites-available/. +Name it zerobin:: + + + ServerName www.yourwebsite.com + + WSGIDaemonProcess zerobin user=www-data group=www-data processes=1 threads=5 + WSGIScriptAlias / /path/to/zerobin/app.wsgi + + + WSGIProcessGroup zerobin + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + + + +Activate the website (as admin):: + + a2ensite zerobin + +And reload the apache configuration (as admin):: + + service apache2 reload + +You'll note that we refer to a file named app.wsgi. It's a Python file +creating the application Apache is going to use to start the Python process:: + + import os, sys + + # make sure the zerobin module is in the PYTHON PATH and importable + ZEROBIN_PARENT_DIR = os.path.dirname(os.path.dirname(__file__)) + sys.path.insert(0, ZEROBIN_PARENT_DIR) + + # create the wsgi callable + from zerobin.routes import get_app + settings, application = get_app(compressed_static=True) + +You can of course create your own, as the `get_app` function is the only +way to pass settings to 0bin with this setup. You would do this by creating +a configuration file and passing it to the function:: + + import os, sys + + ZEROBIN_PARENT_DIR = '/path/to/zerobin/parent/dir' + sys.path.insert(0, ZEROBIN_PARENT_DIR) + + from zerobin.routes import get_app + settings, application = get_app(settings_file='/path/to/settings.py') + +CGI +=== + +You can also run 0bin using CGI, but infortunaly we didn't have time to cover +it yet. Please contact us if you ever get the need to use it. \ No newline at end of file diff --git a/docs/.build/html/_sources/en/nginx_install.txt b/docs/.build/html/_sources/en/nginx_install.txt index cf47a52..165652c 100644 --- a/docs/.build/html/_sources/en/nginx_install.txt +++ b/docs/.build/html/_sources/en/nginx_install.txt @@ -51,9 +51,51 @@ installing it. Vous must create a Nginx configuration file for 0bin. On GNU/Linux, they usually go into /etc/nginx/conf.d/. Name it zerobin.conf. -The minimal file to run the site is: +The minimal configuration file to run the site is:: -But you can make some adjustement to get better perfomances: + server { + listen 80; + server_name www.yourwebsite.com; + + location / { + proxy_pass http://127.0.0.1:8000; + } + } + +`proxy_pass` just passes the external request to the Python process. +The port much match the one used by the 0bin process of course. + +You can make some adjustements to get a better user experience:: + + server { + listen 80; + server_name www.yourwebsite.com; + + location /favicon.ico { + root /path/to/zerobin/static/img; + } + + location /static/ { + root /path/to/zerobin; + gzip on; + gzip_http_version 1.0; + gzip_vary on; + gzip_comp_level 6; + gzip_proxied any; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_buffers 16 8k; + # Disable gzip for certain browsers. + gzip_disable ~@~\MSIE [1-6].(?!.*SV1)~@~]; + expires modified +90d; + } + + location / { + proxy_pass http://zerobin_cherrypy; + } + } + +This make Nginx serve the favicon and static files, set the expire HTTP headers +and make sure gzip compression is used with browsers that support it. diff --git a/docs/.build/html/_sources/en/options.txt b/docs/.build/html/_sources/en/options.txt index eb1da52..9e147f4 100644 --- a/docs/.build/html/_sources/en/options.txt +++ b/docs/.build/html/_sources/en/options.txt @@ -1,15 +1,3 @@ - - ---host=STR - -The host on which to listen for incomming request. Usually 127.0.0.1 to -listen locally or 0.0.0.0 to listen from the outside. - -Default: 127.0.0.1 -Setting file : HOST - - - ============ Options ============ diff --git a/docs/.build/html/_sources/en/theming.txt b/docs/.build/html/_sources/en/theming.txt index e9b15f9..519a6e4 100644 --- a/docs/.build/html/_sources/en/theming.txt +++ b/docs/.build/html/_sources/en/theming.txt @@ -2,9 +2,9 @@ Theming ======= -0bin comes a complete theming support, but for now it's not well ingrated. +0bin comes with a complete theming support, but for now it's not well integrated. -If you wish to create your own theme, you'll need to create template similar +If you wish to create your own theme, you'll need to create templates similar to the ones in zerobin/view, and add the path to the director containing them to the settings file. diff --git a/docs/.build/html/_sources/en/using_supervisor.txt b/docs/.build/html/_sources/en/using_supervisor.txt index 2e9df84..c55824e 100644 --- a/docs/.build/html/_sources/en/using_supervisor.txt +++ b/docs/.build/html/_sources/en/using_supervisor.txt @@ -1,3 +1,72 @@ -==================== +================= Using supervisor -==================== \ No newline at end of file +================= + +Supervisor is a very nice way to manage you Python processes. We won't cover +the setup (which is just apt-get install supervisor or pip install supervisor +most of the time), but here is a quick overview on how to use it. + +Create a configuration file named supervisor.ini:: + + [unix_http_server] + file=/tmp/supervisor.sock; + + [supervisorctl] + serverurl=unix:///tmp/supervisor.sock; + + [rpcinterface:supervisor] + supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface + + [supervisord] + logfile=/tmp/zerobin.log + logfile_maxbytes=50MB + logfile_backups=2 + loglevel=trace + pidfile=/tmp/supervisord.pid + nodaemon=false + minfds=1024 + minprocs=200 + user=zerobin + + [program:zerobin] + command=/path/to/zerobin/zerobin.py --port 80 --compressed-static + directory=/path/to/zerobin/ + environment=PYTHONPATH='/path/to/zerobin/' + user=zerobin + autostart=true + autorestart=true + +The 4 first entries are just boiler plate to get you started, you can copy +them verbatim. + +The last one define one (you can have many) process supervisor should manage. + +It means it will run the command:: + + /path/to/zerobin/zerobin.py --port 80 --compressed-static + +In the directory, with the environnement and the user you defined. + +This command will be ran as a daemon, in the background. + +`autostart` and `autorestart` just make it fire and forget: the site will always be +running, even it crashes temporarly or if you retart the machine. + +The first time you run supervisor, pass it the configuration file:: + + supervisord -c /path/to/supervisor.ini + +Then you can manage the process by running:: + + supervisorctl -c /path/to/supervisor.ini + +It will start a shell from were you can start/stop/restart the service + +You can read all errors that might occurs from /tmp/zerobin.log. + +.. Note:: + + If you installed zerobin in a virtualenv, you may set the command + to run directly from it:: + + command=/path/to/virtualenv/bin/zerobin --port 80 --compressed-static \ No newline at end of file diff --git a/docs/.build/html/_sources/fr/apache_install.txt b/docs/.build/html/_sources/fr/apache_install.txt index 230b736..ce8ed72 100644 --- a/docs/.build/html/_sources/fr/apache_install.txt +++ b/docs/.build/html/_sources/fr/apache_install.txt @@ -2,8 +2,7 @@ Installation avec Apache ========================= -Apache est plus lent, plus lourd, et plus complexe à mettre en oeuvre que Nginx. -Mais il est aussi beaucoup plus connu: +Apache est plus lourd que Nginx mais il est aussi beaucoup plus connu: - plus de gens pourront vous aider les fora; - votre hébergeur propose surement Apache; @@ -34,9 +33,67 @@ l'installation du modle Apache mod_wsgi. Si vous ne savez pas comment faire, ou si vous ne pouvez pas le faire (par exemple sur un hébergement mutualisé qui ne le propose pas), il vous faudra choisir l'installation CGI. +Premièrement, assurez-vous d'avoir mod_wsgi installé et chargé (en tant qu'admin):: -Mod_CGI -========== + a2enmod wsgi + +Ceci va activer mod_wsgi. Si cela ne marche pas, il faudra l'installer d'abord ( +sur ubuntu, le paquet est libapache2-mod-wsgi) + +Ensuite, il faut créer un fichier de configuration Apache, généralement dans +/etc/apache/sites-available/. Nommez le zerobin:: + + + ServerName www.votersiteweb.com + + WSGIDaemonProcess zerobin user=www-data group=www-data processes=1 threads=5 + WSGIScriptAlias / /chemin/vers/zerobin/app.wsgi + + + WSGIProcessGroup zerobin + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + + + +Activez le site web (en tant qu'admin):: + + a2ensite zerobin + +Et rechargez la configuration d'Apache (en tant qu'admin):: + + service apache2 reload + +Vous aurez noté que l'on fait référence à un fichier nommé app.wsgi. C'est un +fichier Python qui créé l'application qu'Apache va utiliser pour lancer le +processus Python:: + + import os, sys + + # s'assurer que le module zerobin est dans le PYTHON PATH et importable + ZEROBIN_PARENT_DIR = os.path.dirname(os.path.dirname(__file__)) + sys.path.insert(0, ZEROBIN_PARENT_DIR) + + # créer le wsgi callable + from zerobin.routes import get_app + settings, application = get_app(compressed_static=True) + +Vous pouvez bien sûr créer le votre, puisque la fonction `get_app` et le seul +moyen de passer des paramètres à 0bin avec cette installation. Cela peut se +faire en créant un fichier de configuration et en le passant à la fonction:: + + import os, sys + + ZEROBIN_PARENT_DIR = '/chemin/du/dossier/parent/de/zerobin' + sys.path.insert(0, ZEROBIN_PARENT_DIR) + + from zerobin.routes import get_app + settings, application = get_app(settings_file='/path/to/settings.py') + +CGI +=== + +Vous pouvez aussi utiliser CGI, mais nous n'avons pas encore eu le temps de +couvrir cette partie. Contactez nous si vous avez besoin de l'utiliser. -Cette installation est considérée comme relativement lente. Mais vous bénéficierez -tout de même de la robustesse d'Apache \ No newline at end of file diff --git a/docs/.build/html/_sources/fr/nginx_install.txt b/docs/.build/html/_sources/fr/nginx_install.txt index e7f1f89..038df8f 100644 --- a/docs/.build/html/_sources/fr/nginx_install.txt +++ b/docs/.build/html/_sources/fr/nginx_install.txt @@ -55,10 +55,53 @@ nous ne couvrirons pas cette partie. Vous devez créer une fichier de configuration Nginx pour 0bin. Sous GNU/Linux, on les mets en général dans /etc/nginx/conf.d/. Nommez le zerobin.conf. -Le fichier minimal pour faire tourner le site est: - -Mais on peut apporter plusieurs améliorations de performance: +Le fichier de configuration minimal pour faire tourner le site est:: + server { + listen 80; + server_name www.votresiteweb.com; + + location / { + proxy_pass http://127.0.0.1:8000; + } + } + +`proxy_pass` transmet les requêtes aux processus Python. Bien entendu le +port doit correspondre à celui utilisé par 0bin. + +On peut apporter plusieurs améliorations à l'expérience utilisateur:: + + server { + listen 80; + server_name www.votresiteweb.com; + + location /favicon.ico { + root /chemin/vers/zerobin/static/img; + } + + location /static/ { + root /chemin/vers/zerobin; + gzip on; + gzip_http_version 1.0; + gzip_vary on; + gzip_comp_level 6; + gzip_proxied any; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_buffers 16 8k; + # Disable gzip for certain browsers. + gzip_disable ~@~\MSIE [1-6].(?!.*SV1)~@~]; + expires modified +90d; + } + + location / { + proxy_pass http://zerobin_cherrypy; + } + } + +Nginx sert maintenant le favicon ainsi que les fichiers statiques, +on a ajouté une date d'expiration dans les en-têtes HTTP +et on s'assure que la compression gzip est utilisée pour les navigateurs +qui la supporte. diff --git a/docs/.build/html/_sources/fr/using_supervisor.txt b/docs/.build/html/_sources/fr/using_supervisor.txt index 4b90a8b..a357fc7 100644 --- a/docs/.build/html/_sources/fr/using_supervisor.txt +++ b/docs/.build/html/_sources/fr/using_supervisor.txt @@ -1,3 +1,75 @@ ==================== Utiliser supervisor -==================== \ No newline at end of file +==================== + +Supervisor est un très bon moyen de gérer des processus Python. Nous n'allons +pas couvrir son installation (qui la plupart du temps se résume à +apt-get install supervisor ou pip install supervisor), mais voici un rapide +résumé de comment l'utiliser: + +Créez un fichier de configuration nommé supervisor.ini:: + + [unix_http_server] + file=/tmp/supervisor.sock; + + [supervisorctl] + serverurl=unix:///tmp/supervisor.sock; + + [rpcinterface:supervisor] + supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface + + [supervisord] + logfile=/tmp/zerobin.log + logfile_maxbytes=50MB + logfile_backups=2 + loglevel=trace + pidfile=/tmp/supervisord.pid + nodaemon=false + minfds=1024 + minprocs=200 + user=zerobin + + [program:zerobin] + command=/chemin/vers/zerobin/zerobin.py --port 80 --compressed-static + directory=/chemin/vers/zerobin/ + environment=PYTHONPATH='/chemin/vers/zerobin/' + user=zerobin + autostart=true + autorestart=true + +Les 4 premières entrées sont juste de la configuration standard et vous pouvez +les copier telles qu'elles. + +La dernière entrée définie un processus (il peut y en avoir plusieurs) +que supervisor doit gérer. + +Cela veut dire qu'il va lancer la commande:: + + /chemin/vers/zerobin/zerobin.py --port 80 --compressed-static + +Et ceci dans le dossier, avec l'environnement et l'utilisateur défini, le tout +en arrière plan en tant que daemon. + +`autostart` et `autorestart` permettent simplement de le lancer et de l'oublier: +supervisor redémarera le processus automatiquement en cas d'arrêt impromptu. + +La première fois que vous lancez supervisor, passez lui le fichier de configuration:: + + supervisord -c /chemin/vers/supervisor.ini + +Ensuite vous pouvez gérer les processus avec:: + + supervisorctl -c /chemin/vers/supervisor.ini + +Cela va démarrer un shell depuis lequel vous pouvez faire un start/stop/restart +sur le service. + +Toutes les erreurs seront logguées dans /tmp/zerobin.log. + + +.. Note:: + + Si vous avez installé zerobin dans un virtualenv, vous devriez définir la + commande pour qu'elle s'éxécute depuis le virtualenv:: + + command=/chemin/vers/le/virtualenv/bin/zerobin --port 80 --compressed-static \ No newline at end of file diff --git a/docs/.build/html/_sources/index.txt b/docs/.build/html/_sources/index.txt index 3ef5a74..4a7d7db 100644 --- a/docs/.build/html/_sources/index.txt +++ b/docs/.build/html/_sources/index.txt @@ -27,12 +27,5 @@ +-------------------------+--------------------------------+ -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - .. _Signaler un bug: https://github.com/sametmax/0bin/issues .. _Report a bug: \ No newline at end of file diff --git a/docs/.build/html/en/apache_install.html b/docs/.build/html/en/apache_install.html index bba88f7..6b58a18 100644 --- a/docs/.build/html/en/apache_install.html +++ b/docs/.build/html/en/apache_install.html @@ -53,8 +53,7 @@

Apache setup

-

Apache is slower, heavier and more complicated to setup than Nginx. But it’s also -much more famous:

+

Apache is heavier than Nginx. But it’s also much more famous:

+
+

CGI

+

You can also run 0bin using CGI, but infortunaly we didn’t have time to cover +it yet. Please contact us if you ever get the need to use it.

@@ -95,6 +148,7 @@ robustness.

diff --git a/docs/.build/html/en/nginx_install.html b/docs/.build/html/en/nginx_install.html index b936466..679e4f0 100644 --- a/docs/.build/html/en/nginx_install.html +++ b/docs/.build/html/en/nginx_install.html @@ -95,8 +95,48 @@ separate process let you do this without having to restart the server.

installing it.

Vous must create a Nginx configuration file for 0bin. On GNU/Linux, they usually go into /etc/nginx/conf.d/. Name it zerobin.conf.

-

The minimal file to run the site is:

-

But you can make some adjustement to get better perfomances:

+

The minimal configuration file to run the site is:

+
server {
+    listen       80;
+    server_name www.yourwebsite.com;
+
+    location / {
+        proxy_pass http://127.0.0.1:8000;
+    }
+}
+
+

proxy_pass just passes the external request to the Python process. +The port much match the one used by the 0bin process of course.

+

You can make some adjustements to get a better user experience:

+
server {
+    listen       80;
+    server_name www.yourwebsite.com;
+
+    location /favicon.ico {
+        root  /path/to/zerobin/static/img;
+    }
+
+    location /static/ {
+        root  /path/to/zerobin;
+        gzip  on;
+        gzip_http_version 1.0;
+        gzip_vary on;
+        gzip_comp_level 6;
+        gzip_proxied any;
+        gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
+        gzip_buffers 16 8k;
+        # Disable gzip for certain browsers.
+        gzip_disable ~@~\MSIE [1-6].(?!.*SV1)~@~];
+        expires modified +90d;
+    }
+
+    location / {
+        proxy_pass http://zerobin_cherrypy;
+    }
+}
+
+

This make Nginx serve the favicon and static files, set the expire HTTP headers +and make sure gzip compression is used with browsers that support it.

diff --git a/docs/.build/html/en/options.html b/docs/.build/html/en/options.html index cb523fb..e4d7409 100644 --- a/docs/.build/html/en/options.html +++ b/docs/.build/html/en/options.html @@ -51,12 +51,7 @@
-

–host=STR

-

The host on which to listen for incomming request. Usually 127.0.0.1 to -listen locally or 0.0.0.0 to listen from the outside.

-

Default: 127.0.0.1 -Setting file : HOST

-
+

Options

0bin’s behavior can be adjusted with options passed using a configuration file or directly using the command line. Some parameters are only available diff --git a/docs/.build/html/en/theming.html b/docs/.build/html/en/theming.html index cf4712a..5671842 100644 --- a/docs/.build/html/en/theming.html +++ b/docs/.build/html/en/theming.html @@ -53,8 +53,8 @@

Theming

-

0bin comes a complete theming support, but for now it’s not well ingrated.

-

If you wish to create your own theme, you’ll need to create template similar +

0bin comes with a complete theming support, but for now it’s not well integrated.

+

If you wish to create your own theme, you’ll need to create templates similar to the ones in zerobin/view, and add the path to the director containing them to the settings file.

You’ll also need to copy static files from zerobin/static to a new direcotry diff --git a/docs/.build/html/en/using_supervisor.html b/docs/.build/html/en/using_supervisor.html index c55b3e7..c87f36a 100644 --- a/docs/.build/html/en/using_supervisor.html +++ b/docs/.build/html/en/using_supervisor.html @@ -26,8 +26,8 @@ - - + +

diff --git a/docs/.build/html/fr/using_supervisor.html b/docs/.build/html/fr/using_supervisor.html index 648fd87..b0fe78e 100644 --- a/docs/.build/html/fr/using_supervisor.html +++ b/docs/.build/html/fr/using_supervisor.html @@ -26,7 +26,7 @@ - + @@ -37,7 +37,7 @@ index
  • - next |
  • Utiliser supervisor

    +

    Supervisor est un très bon moyen de gérer des processus Python. Nous n’allons +pas couvrir son installation (qui la plupart du temps se résume à +apt-get install supervisor ou pip install supervisor), mais voici un rapide +résumé de comment l’utiliser:

    +

    Créez un fichier de configuration nommé supervisor.ini:

    +
    [unix_http_server]
    +file=/tmp/supervisor.sock;
    +
    +[supervisorctl]
    +serverurl=unix:///tmp/supervisor.sock;
    +
    +[rpcinterface:supervisor]
    +supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
    +
    +[supervisord]
    +logfile=/tmp/zerobin.log
    +logfile_maxbytes=50MB
    +logfile_backups=2
    +loglevel=trace
    +pidfile=/tmp/supervisord.pid
    +nodaemon=false
    +minfds=1024
    +minprocs=200
    +user=zerobin
    +
    +[program:zerobin]
    +command=/chemin/vers/zerobin/zerobin.py --port 80 --compressed-static
    +directory=/chemin/vers/zerobin/
    +environment=PYTHONPATH='/chemin/vers/zerobin/'
    +user=zerobin
    +autostart=true
    +autorestart=true
    +
    +

    Les 4 premières entrées sont juste de la configuration standard et vous pouvez +les copier telles qu’elles.

    +

    La dernière entrée définie un processus (il peut y en avoir plusieurs) +que supervisor doit gérer.

    +

    Cela veut dire qu’il va lancer la commande:

    +
    /chemin/vers/zerobin/zerobin.py --port 80 --compressed-static
    +
    +

    Et ceci dans le dossier, avec l’environnement et l’utilisateur défini, le tout +en arrière plan en tant que daemon.

    +

    autostart et autorestart permettent simplement de le lancer et de l’oublier: +supervisor redémarera le processus automatiquement en cas d’arrêt impromptu.

    +

    La première fois que vous lancez supervisor, passez lui le fichier de configuration:

    +
    supervisord -c /chemin/vers/supervisor.ini
    +
    +
    +

    Ensuite vous pouvez gérer les processus avec:

    +
    supervisorctl -c /chemin/vers/supervisor.ini
    +
    +
    +

    Cela va démarrer un shell depuis lequel vous pouvez faire un start/stop/restart +sur le service.

    +

    Toutes les erreurs seront logguées dans /tmp/zerobin.log.

    +
    +

    Note

    +

    Si vous avez installé zerobin dans un virtualenv, vous devriez définir la +commande pour qu’elle s’éxécute depuis le virtualenv:

    +
    command=/chemin/vers/le/virtualenv/bin/zerobin --port 80 --compressed-static
    +
    +
  • @@ -66,7 +128,7 @@ title="previous chapter">Installation avec Nginx

    Next topic

    <no title>

    + title="next chapter">Personnaliser l’apparence

    This Page

    - @@ -108,14 +100,6 @@
    -

    Table Of Contents

    - -

    Next topic

    Introduction

    diff --git a/docs/.build/html/searchindex.js b/docs/.build/html/searchindex.js index 71a1a6c..f27e185 100644 --- a/docs/.build/html/searchindex.js +++ b/docs/.build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{},terms:{all:[11,7,2,14],code:[2,3,9,5,6,7,11,10],savez:4,month:11,"requ\u00eat":[9,6,4,8],abil:3,edu:[],largement:[6,8],follow:14,"\u00e9tape":9,"s\u00e9curit\u00e9":[9,6,4,8],privat:2,accur:11,ver:[9,8],pouvoir:8,vizhash:[11,6],"mani\u00e8r":[6,4],lourd:4,"h\u00e9berg":6,utilis:[0,5,6,8,12],under:[3,11,14],"l\u00e9ger":9,aux:[5,8],worth:11,sent:11,toucher:9,"am\u00e9lior":9,sourc:[0,5,2],prendr:9,fals:[1,8],projet:[9,6,4],sont:[9,5,6,8,10],stackoverflow:[],veri:[3,7,2],appar:[0,10],syntax:[4,14],voir:9,productif:6,cool:[5,2],appart:11,level:11,you_ip:[],gnu:[3,9,5,2],list:[11,6,1,8],upload:[11,6],"try":[3,0],item:1,adjust:[3,1],small:2,cherrypy_:[],setup:[3,0,2,14],pleas:7,bottlepi:[],slower:14,aider:4,direct:[8,10],focu:11,past:[11,6,1,8],consequ:11,second:[5,2],droit:[9,5,4,8],pass:[1,8],download:[1,2,8],throttl:[3,11,14],click:[11,6],fonction:6,even:[3,11,1,2,14],index:0,what:11,appear:11,abl:[1,2,14],quelqu:[6,8],"\u00e9l\u00e9ment":8,cell:4,clipboard:11,sur:[9,5,6,4,8],"new":7,net:[0,11],"charg\u00e9":9,performant:[4,14],hash:[11,6],chose:[11,8],fichier:[10,9,5,6,4,8],gener:[11,1],never:11,utilisateur:8,met:9,slow:14,let:[3,14],"\u00e9tait":6,address:[5,1,2,8],path:[7,1],papier:6,modifi:[1,10],valu:1,wait:11,"associ\u00e9":6,"tr\u00e8":[9,5,6,10],search:0,tant:5,"d\u00e9truit":6,"v\u00e9rific":6,forum:14,"r\u00e9cup\u00e8r":6,technolog:[11,6],step:3,adopt:[1,8],utilisat:6,"post\u00e9":6,contr:8,implement:11,chanc:[3,9,4,14],portabl:5,robustess:4,autant:6,apach:[0,2,3,9,5,4,14],modul:[3,0,14,4,9],"pr\u00e9cise":6,quel:6,qui:[6,4,8,10],api:[11,6],visibl:[3,9],instal:[0,2,3,9,5,6,4,11,14],"cr\u00e9ation":6,pastebin:[0,11,6],from:[1,2,3,7,8,11,14],would:11,memori:3,two:3,websit:2,faudra:4,choisi:6,priotiti:1,care:7,type:[11,6],tell:11,tightli:7,more:[11,2,14],peopl:14,"utilis\u00e9":6,auront:8,site:[1,2,3,9,5,4,8,14],apport:9,visual:11,indic:0,known:11,parefeu:5,compani:2,easiest:[3,0,2],must:[3,11],none:1,soit:6,programming_languag:[],car:6,flash:[11,6],work:[3,11,14],uniqu:[9,6,8],pour:[10,9,5,6,4,8],histori:11,"g\u00e9rer":9,can:[0,1,2,3,7,11,14],jamai:6,"pr\u00e9cis\u00e9":8,complic:14,raison:[9,8],process:[3,1,2,14],construir:8,sudo:[5,1,2,8],share:2,partag:5,accept:6,unzip:[5,2],cassent:6,suivant:[4,8],occur:6,clair:6,aes256:[11,6],cours:7,end:[3,9,4,14],meilleur:[9,6],secur:[3,2,14],ordinari:1,microframework:[11,6],rapport:6,how:[11,14],instead:[11,1],simpl:[3,0,5,7,9],css:[1,8],updat:3,product:[1,8],clone:[11,6],after:[11,1],essayera:8,befor:[],wrong:1,plane:11,coup:6,attent:10,vient:5,mai:[9,6,4,8,10],data:11,mal:[8,10],souci:10,util:8,"short":11,couvriron:9,seriou:7,"h\u00e9bergement":4,liner:2,element:[],issu:11,inform:[1,8],allow:11,entrepris:5,make:[3,11,2],extrait:5,"m\u00e9moir":9,"d\u00e9faut":8,puisqu:6,becaus:11,peut:[9,5,6,8],directi:1,afin:[8,10],entitl:11,nombr:[9,6,4],connait:6,group:[1,8],"support\u00e9":6,fix:11,visuel:6,better:[3,11],html:[7,10],requir:14,"arri\u00e8r":5,suffit:5,"op\u00e9rat":6,therefor:[3,11],"g\u00e9n\u00e9ralement":8,absolu:8,nom:8,them:[7,11,1],crash:[3,9,4,14],thei:[3,7],python:[1,2,3,9,5,6,4,8,11,14],dan:[9,5,6,8,10],taill:[6,1,8],dai:11,initi:11,"break":11,framework:[11,6],autr:[9,6,8],front:[3,9,4,14],devez:9,direcotri:[7,1],now:[7,2],"possibilit\u00e9":[9,4],introduct:[0,11,6],choic:3,name:[3,1],edit:[3,11,7],aucun:[9,6,8],crypto:[11,6],separ:3,easili:11,"install\u00e9":9,bootstrap_:[],mode:[1,8],each:1,debug:[1,8],choix:9,modl:4,side:0,mean:3,cett:[9,4],dispon:8,cherrypi:[11,6],lign:8,"0bin":[0,1,2,3,9,5,6,7,8,11,10],idea:11,"cr\u00e9er":[9,6,8,10],"static":[1,2,5,7,8,10],"r\u00e9seau":5,sametmax:[1,8],happen:11,dispos:[3,14],"probl\u00e8m":6,out:2,safeti:11,"cl\u00e9":6,reload:1,goe:1,stanford:[],content:[11,1,8],contenu:6,"d\u00e9marrag":8,valeur:[1,8],rel:1,"premi\u00e8r":6,serveur:[9,6,4,8],pui:10,ineffici:11,compri:6,reason:3,que:[5,6,4,8,10],"s\u00e9curis\u00e9":[5,4,14],assurez:5,org:[],oeil:5,md5:[],contient:8,ajoutez:8,plusieur:[9,5,6,4],installt:5,lancez:[9,5],place:[7,8],chaqu:8,outsid:[3,1],contienn:8,tournent:[9,4],think:11,lesquel:8,first:[11,1],oper:11,fait:6,major:11,directli:1,gracieus:6,famou:14,mise:9,"apr\u00e8":8,suffis:6,votr:[9,5,4,8,10],affich:8,donc:[9,6],alreadi:2,"int\u00e9gralit\u00e9":9,facil:[6,4,14],ont:8,size:[11,1],prioriti:1,paste_files_root:[1,8],fonctionn:[9,4],surement:4,avec:[0,9,5,6,4,8],top:1,tou:[5,6,4,10],avez:[9,10],too:[11,7],store:[11,2],listen:[3,1,14],shell:[5,2],option:[0,5,1,2,8],big:[11,2],tool:[11,6],copi:[11,7],specifi:11,github:[0,1,8],prend:8,anybodi:[11,2],than:[11,14],serv:[3,1,8],wide:11,sert:[9,8],prevent:11,jqueri:[11,6],connu:[6,4],str:1,sera:[5,8],"organis\u00e9":10,browser:11,"red\u00e9marr":9,bootstrap:[11,6],"acc\u00e8":8,"plut\u00f4t":6,syntaxiqu:6,modern:[4,14],"qualit\u00e9":6,ani:[3,11,1],"minifi\u00e9":8,faut:[9,10],expir:[11,6],have:[1,2,3,7,11,14],tabl:0,need:[11,7,14],featur:11,ainsi:[9,8],"priorit\u00e9":8,recharg:8,jour:[9,6],built:2,equival:[1,8],destroi:11,choisir:4,filet:6,port:[1,2,3,9,5,8,14],note:[5,2],also:[7,1,14],without:[3,0],deux:9,noth:11,pratiqu:9,dernier:5,"d\u00e9gradat":6,sure:2,oeuvr:4,"sp\u00e9cifier":6,previou:11,compress:[5,1,2,8],doit:8,most:14,plan:5,pair:[1,8],sjcl_:[],"class":[7,10],charg:[9,4],don:14,technoligi:[],commentair:6,url:[11,6],later:1,request:[3,11,1,14],doe:11,part:11,"s\u00e9rieux":10,efficac:6,js_:[],gracefulli:11,personnalis:[0,10],recipi:11,nettoy:6,wsgi:[4,14],show:1,ajout:[6,10],random:11,perfom:3,prix:6,contactez:10,font:6,help:[1,8,14],absolut:1,serait:6,firewal:2,ratio:[11,6],menu:[1,8],configur:[1,2,3,9,5,4,8,14],solut:[5,4,2,14],souhaitez:[5,8,10],should:1,theme:[0,7,10],version:[5,1,2,8],"capacit\u00e9":9,templat:[7,1,8,10],local:[1,2,3,9,5,8],get:[3,0,11,6,1],familiar:14,raccourcisseur:6,compressed_static_fil:[1,8],mainten:5,mieux:6,populair:9,report:0,gen:4,restart:3,ingrat:7,nouveau:10,processu:[9,5,4,8],extract:2,organ:7,historiqu:6,mettr:[5,4],stuff:[5,2],she:11,tourner:[9,5],contain:[7,1],where:[7,1,2],view:[7,1,8,10],wiki:[],set:[7,1,8,10],fair:[9,5,6,4],"color\u00e9":6,automatiqu:[6,8],heavili:1,touch:3,see:[3,2],signifi:10,"recommand\u00e9":[5,4],best:[3,2,14],jetez:5,"pr\u00e9vention":6,still:14,databas:0,someth:[7,1,2],wikipedia:[],pouvez:[5,4,10],bien:10,won:[3,11,2,14],chemin:[8,10],entrant:8,propr:[9,6,8,10],"import":[6,1,8],paramet:1,email:[1,8],tenu:6,"int\u00e9gr\u00e9":[5,10],vaut:6,kei:11,effet:9,screen:[5,2],javascript:[7,10],dossier:[5,8,10],comm:[9,4],html5:[11,6],afffich:8,avon:6,come:[11,7,2],"pr\u00e9vu":6,protect:1,"d\u00e9pendant":10,last:2,ell:[6,4],admin:[1,2,3,9,5,4,8,14],against:1,"re\u00e7oit":6,etc:[3,9],tout:[6,4,8],erreur:8,"b\u00e9n\u00e9ficierez":[9,4],mani:[],com:[1,8],nohup:[5,2],load:[3,14],"c\u00f4t\u00e9":6,sjcl:[11,6],point:[11,6],color:[11,6],ubuntu:[5,2],cepend:10,essayez:[9,5],changement:9,besoin:[6,10],linux:[2,3,9,5,6,11],"cons\u00e9quenc":6,duplic:11,mailto:[1,8],fanci:11,contraint:6,coupl:7,copier:[6,10],add:[7,11,1],"s\u00e9par\u00e9":9,depui:[9,5,8],much:[3,11,14],"\u00e9couter":[9,8],"fonctionalit\u00e9":6,petit:5,"m\u00eame":[9,5,6,4],suffira:6,"fran\u00e7ai":0,premier:8,"am\u00e9lioron":10,aussi:[4,8,14],imag:[1,8],mod_cgi:4,allez:5,minifi:1,demand:4,"h\u00e9bergeur":4,buld:1,"case":11,heavier:14,onli:[3,11,1],look:[7,1],packag:3,solid:[5,4,14],servic:[11,6],"appel\u00e9":8,"while":11,couvrieron:4,behavior:1,error:1,aid:8,servir:[9,8],sanit:11,"mutualis\u00e9":4,project:[3,11,14],conten:10,beaucoup:[6,4,14],comport:8,vou:[10,3,9,5,4,8],conf:[3,9],lightweight:3,incom:1,template_dir:[1,8],sever:[3,11,2,14],"g\u00e9n\u00e9rer":8,alor:6,par:[4,8,10],quand:[9,8],welcom:11,minim:[3,9],perform:[3,9],parti:[9,6,4],"imm\u00e9diat":9,shorten:11,same:14,"h\u00f4te":8,handl:[11,2],complex:4,"d\u00e9chiffr":6,"\u00e9coutant":[9,4],document:0,mod_wsgi:[4,14],complet:[7,10],"consid\u00e9r\u00e9":4,http:[5,1,2,8],"mod\u00e9rer":6,personn:[6,2],effect:3,hand:11,director:7,moment:10,fruit:11,user:[1,3,9,4,8,14],improv:7,moyen:[5,6],php:[3,9],chang:3,"modifi\u00e9":8,lower:11,moder:11,paquet:[9,4],modifici:9,"\u00e9galement":10,default_set:[1,8],whole:3,"poss\u00e8d":10,"affich\u00e9":6,well:7,lequel:8,"famili\u00e8r":4,exampl:1,command:[1,8],thi:[1,2,3,7,11,14],english:0,san:9,"pass\u00e9":8,voulez:8,propos:4,comment:[4,11,6,1],"g\u00e9n\u00e8re":6,identifi:6,just:[11,6,7,2],less:[3,14],laptop:2,habituel:[9,4],pourront:4,via:6,"envoy\u00e9":6,nou:[9,6,4,10],"\u00e9dite":9,"al\u00e9atoir":6,defauls_set:[1,8],concentr:6,web:[1,3,5,6,4,11,14],rapid:[9,8],"chiffr\u00e9":6,easi:[11,2,14],apparaitra:6,exempl:[5,4,8],"ajust\u00e9":8,other:[3,11],"comment\u00e9":8,contrair:9,immediatli:3,static_files_root:[1,8],save:1,adress:8,app:11,python_:[],css3:[11,6],applic:6,march:6,which:1,essayeron:6,pouvon:6,read:11,disposit:[9,4],haut:8,autodesctruct:6,supervisord:[5,2],nginx:[0,2,3,9,5,4,14],moi:6,raccourcir:6,traffic:[5,2],usual:[3,1],background:2,enrypt:[],similair:10,gestionnair:[9,4],aurez:10,like:[3,14],signal:0,"d\u00e9boguer":8,server:[3,9,11,1,14],benefit:[3,14],href:[],"id\u00e9":6,popular:3,page:[0,1,8],www:[],titl:[],often:3,twitter:[11,6],some:[3,11,1],begin:1,certain:8,bloqu:5,home:[1,8],sprint:[5,2],"r\u00e9pareron":6,"red\u00e9mar":9,virtualenv:[],rien:6,est:[10,9,6,4,8,14],langag:6,peu:[9,6,4],prot:[9,4],octet:[1,8],conteneur:6,contact:[7,1,8],"voil\u00e0":[],foo:[1,8],avoir:[9,5,4],foi:9,cgi:[4,14],coller:6,plu:[0,9,5,6,4,8,14],run:[3,0,1,2,14],"prot\u00e9g\u00e9":8,burn:11,"d\u00e9compressez":5,"d\u00e9chiffrer":6,host:[1,2,3,9,5,8,11,14],wget:[5,2],habitud:9,handi:3,about:11,"syst\u00e8m":8,"\u00eatre":[9,5,6,8],permet:[9,6],"ext\u00e9rieur":[9,8],approxim:[1,8],"g\u00e9ron":6,produc:[],block:2,client:[0,11,6],own:[3,7,11,1],consid:14,press:6,lent:4,lien:8,automat:[11,1],son:8,nommez:9,right:[3,1,2,14],sou:[9,5,6,4],encor:6,your:[1,2,3,5,7,8,14],manag:3,robust:[3,11,2,14],"bugg\u00e9":6,log:[11,6],wai:[11,1,2,14],spam:[1,8],support:[10,5,6,7,11,14],question:[],fast:3,avail:1,start:1,zerobin:[1,2,3,9,5,6,7,8,11,10],interfac:14,includ:11,lot:[11,14],"\u00e9dition":6,attendr:6,"stock\u00e9":6,bottl:[11,6],zip:[5,2],simplement:5,lancer:5,fora:4,legal:11,link:1,"g\u00e9n\u00e9ral":[9,8],ordinnair:8,lanc:[9,8],line:[5,1],buggi:11,bug:0,fort:[9,4],heavi:[3,14],"donn\u00e9":6,possibl:[3,6,14],"default":1,wish:[7,1,2],access:[5,1,2],displai:[11,1],niveau:6,limit:[1,9,6,4,8,11],entendu:10,similar:7,penson:6,"\u00e9ditez":10,supervisor:[0,12,13],creat:[3,7,11,1],chercher:8,cover:3,dure:2,decrypt:11,doesn:[3,2,14],lectur:6,dupliqu:6,file:[1,2,3,7,8,11,14],pip:[5,2],check:[11,2],probabl:[11,6,14],chiffrement:6,encrypt:[0,11],"pr\u00e9c\u00e9dent":6,know:[11,2,14],relatif:8,personnel:5,when:[3,11,1],ceux:10,asbolut:1,collis:[11,6],"interfa\u00e7ag":4,relativ:4,gro:[5,6],you:[1,2,3,7,11,14],connaissez:5,"t\u00e9l\u00e9charger":5,chacun:6,norm:[4,14],souhait:8,developp:1,max_siz:[1,8],"param\u00e8tr":8,navigateur:6,"solidit\u00e9":[9,4],"impl\u00e9ment":6,network:2,receiv:11,"d\u00e9fault":10,faster:1,"simplicit\u00e9":10,directori:[7,1],jquery_:[],"d\u00e9but":8,"d\u00e9velopp":8,"pr\u00e9sent":[8,10],utilisez:10,statiqu:[8,10],sauvegard:8,time:3,serious:11,degrad:11},objtypes:{},titles:["0bin’s documentation","Options","Easiest installation","Nginx setup","Installation avec Apache","Installation la plus simple","Introduction","Theming","Options","Installation avec Nginx","Personnaliser l’apparence","Introduction","Utiliser supervisor","Using supervisor","Apache setup"],objnames:{},filenames:["index","en/options","en/easy_install","en/nginx_install","fr/apache_install","fr/easy_install","fr/intro","en/theming","fr/options","fr/nginx_install","fr/theming","en/intro","fr/using_supervisor","en/using_supervisor","en/apache_install"]}) \ No newline at end of file +Search.setIndex({objects:{},terms:{all:[2,7,4,10,13,11],code:[2,3,9,5,6,4,10,14],forget:13,raison:[9,8],global:[7,11],savez:7,month:10,veut:12,"requ\u00eat":[9,6,7,8],aider:7,edu:[],largement:[6,8],follow:11,"\u00e9tape":9,"s\u00e9curit\u00e9":[9,6,7,8],a2enmod:[7,11],privat:2,accur:10,ver:[9,7,8,12],pouvoir:8,vizhash:[10,6],"mani\u00e8r":[6,7],lourd:7,autodesctruct:6,"h\u00e9berg":6,program:[12,13],autostart:[12,13],under:[3,10,11],"l\u00e9ger":9,aux:[9,5,8],cgi:[7,11],worth:10,sent:10,"am\u00e9lior":9,sourc:[0,5,2],"50mb":[12,13],prendr:9,fals:[1,8,13,12],projet:[9,6,7],personnel:5,sont:[14,9,5,6,8,12],stackoverflow:[],veri:[3,4,2,13],appar:[0,14],perfom:[],voir:9,nodaemon:[12,13],cool:[5,2],foo:[1,8],appart:10,level:10,you_ip:[],gnu:[3,9,5,2],list:[10,6,1,8],upload:[10,6],"try":[3,0],item:1,adjust:[3,1],plain:[3,9],small:2,cherrypy_:[],dir:11,dirnam:[7,11],pleas:[4,11],bottlepi:[],slower:[],abil:3,"derni\u00e8r":12,direct:[8,14],infortunali:11,focu:10,past:[10,6,1,8],consequ:10,second:[5,2],droit:[9,5,7,8],pass:[3,1,8,13,11],download:[1,2,8],run:[0,1,2,3,13,11],permett:12,click:[10,6],fonction:[6,7],even:[1,2,3,10,13,11],index:[],what:10,appear:10,abl:[1,2,11],quelqu:[6,8],"\u00e9l\u00e9ment":8,cell:7,version:[5,1,2,8],sur:[9,5,6,7,8,12],"90d":[3,9],deux:9,"new":4,net:[0,10],ever:11,cela:[7,12],"charg\u00e9":[9,7],performant:[7,11],hash:[10,6],chose:[10,8],absolut:1,gener:[10,1],never:10,utilisateur:[9,8,12],here:13,met:9,firewal:2,let:[3,11],"\u00e9tait":6,"s\u00fbr":7,path:[1,3,4,7,13,11],papier:6,modifi:[3,9,1,14],valu:1,wait:10,"associ\u00e9":6,"tr\u00e8":[9,5,6,14,12],search:[],servir:[9,8],"d\u00e9truit":6,"v\u00e9rific":6,forum:11,"r\u00e9cup\u00e8r":6,slow:[],technolog:[10,6],step:3,later:1,utilisat:6,"post\u00e9":6,contr:8,implement:10,minfd:[12,13],chanc:[3,9,7,11],portabl:5,flash:[10,6],autant:6,solut:[5,7,2,11],modul:[3,9,7,11],"pr\u00e9cise":6,apt:[12,13],souhaitez:[5,8,14],assurez:[5,7],unix:[12,13],api:[10,6],visibl:[3,9],instal:[0,2,3,9,5,6,7,10,12,13,11],should:[1,13],from:[1,2,3,4,7,8,10,13,11],would:[10,11],memori:3,two:3,dure:2,logfile_backup:[12,13],websit:[2,11],faudra:7,priotiti:1,md5:[],type:[10,6],tell:[10,12],tightli:4,more:[10,2,11],contient:8,votersiteweb:7,peopl:11,"utilis\u00e9":[9,6],auront:8,comport:8,apport:9,visual:10,indic:[],known:10,parefeu:5,compani:2,easiest:[3,0,2],must:[3,10],none:1,vou:[14,3,9,5,7,8,12],programming_languag:[],car:6,setup:[3,0,2,13,11],work:[3,10,11],uniqu:[9,6,8],pour:[14,9,5,6,7,8,12],histori:10,impromptu:12,"g\u00e9rer":[9,12],can:[0,1,2,3,4,10,13,11],root:[3,9],jamai:6,"pr\u00e9cis\u00e9":8,abord:7,conf:[3,9],process:[1,2,3,7,13,11],construir:8,sudo:[5,1,2,8],share:2,partag:5,accept:6,unzip:[5,2],cassent:6,suivant:[7,8],occur:[6,13],clair:6,ratio:[10,6],alwai:13,aes256:[10,6],cours:[3,4,11],end:[3,9,7,11],"h\u00e9bergement":7,produc:[],ordinari:1,"ext\u00e9rieur":[9,8],rapport:6,how:[10,13,11],daemon:[12,13],instead:[10,1],simpl:[3,0,5,4,9],couvrir:[7,12],css:[3,9,1,8],updat:3,product:[1,8],clone:[10,6],after:[10,1],essayera:8,befor:[],wrong:1,plane:10,attent:14,vient:5,mai:[14,9,6,7,8,12,13],data:[10,7,11],mal:[8,14],souci:14,util:8,"short":10,couvriron:9,loglevel:[12,13],seriou:4,secur:[3,2,11],liner:2,element:[],issu:10,inform:[1,8],environ:[12,13],allow:[10,7,11],entrepris:5,callabl:[7,11],order:[7,11],extrait:5,"m\u00e9moir":9,max_siz:[1,8],"d\u00e9faut":8,puisqu:[6,7],becaus:10,peut:[9,5,6,7,8,12],directi:1,afin:[8,14],entitl:10,nombr:[9,6,7],paramet:1,group:[7,1,8,11],img:[3,9],fix:10,visuel:6,productif:6,better:[3,10],complex:[],restart:[3,12,13],"arri\u00e8r":[5,12],famou:11,bin:[12,13],"op\u00e9rat":6,therefor:[3,10],might:13,"g\u00e9n\u00e9ralement":[7,8],absolu:8,nom:8,them:[4,10,1,13],crash:[3,9,7,13,11],thei:[3,4],python:[1,2,3,9,5,6,7,8,10,12,13,11],dan:[14,9,5,6,7,8,12],taill:[6,1,8],dai:10,initi:10,"break":10,framework:[10,6],autr:[9,6,8],front:[3,9,7,11],devez:9,direcotri:[4,1],now:[4,2],"possibilit\u00e9":[9,7],introduct:[0,10,6],choic:3,name:[3,1,13,11],edit:[3,10,4],aucun:[9,6,8],didn:11,crypto:[10,6],separ:3,easili:10,"install\u00e9":[9,7,12],bootstrap_:[],mode:[1,8],each:1,debug:[1,8],choix:9,modl:7,side:0,"\u00e9ditez":14,mean:[3,13],cett:[9,7],dispon:8,supervisorctl:[12,13],lign:8,"int\u00e9gralit\u00e9":9,idea:10,"cr\u00e9er":[9,6,7,8,14],"static":[1,2,3,9,5,4,8,12,13,14],"r\u00e9seau":5,sametmax:[1,8],happen:10,dispos:[3,11],"probl\u00e8m":6,out:2,petit:5,safeti:10,"cl\u00e9":6,mettr:5,goe:1,proxy_pass:[3,9],stanford:[],"nomm\u00e9":[7,12],load:[3,11],content:[10,1,8],contenu:6,"d\u00e9marrag":8,valeur:[1,8],rel:1,"arr\u00eat":12,msie:[3,9],serveur:[9,6,7,8],prioriti:1,pui:14,standard:12,compri:6,robustess:[],reason:3,sock:[12,13],que:[14,9,5,6,7,8,12],dire:12,"s\u00e9curis\u00e9":[5,7,11],qui:[14,9,6,7,8,12],org:[],oeil:5,care:4,ensuit:[7,12],perform:[3,9],ajoutez:8,thread:[7,11],spam:[1,8],installt:5,"loggu\u00e9":12,lancez:[9,5,12],place:[4,8],chaqu:8,outsid:[3,1],contienn:8,tournent:[9,7],think:10,lesquel:8,first:[10,1,13,11],oper:10,wiki:[],major:10,celui:9,directli:[1,13],gracieus:6,suffit:5,mise:9,"apr\u00e8":8,suffis:6,votr:[9,5,7,8,14],affich:8,donc:[9,6],alreadi:2,zerobin_parent_dir:[7,11],"0bin":[0,1,2,3,4,5,6,7,8,9,10,11,14],facil:[6,7,11],ont:8,size:[10,1],passer:7,paste_files_root:[1,8],fonctionn:[9,7],surement:7,passez:12,avec:[0,9,5,6,7,8,12],top:1,settings_fil:[7,11],tou:[5,6,7,14],avez:[9,7,14,12],too:[10,4],"not\u00e9":7,plupart:12,store:[10,2],listen:[3,9,1,11],shell:[5,2,13,12],option:[0,5,1,2,8],tool:[10,6],copi:[10,4,13],specifi:10,permet:[9,6],prend:8,zerobin_cherrypi:[3,9],"\u00e9galement":14,anybodi:[10,2],than:[10,11],rss:[3,9],serv:[3,1,8],wide:10,sert:[9,8],prevent:10,"\u00e9dition":6,jqueri:[10,6],connu:[6,7],str:[],were:13,"organis\u00e9":14,logfile_maxbyt:[12,13],browser:[3,9,10],"red\u00e9marr":9,passant:7,bootstrap:[10,6],"acc\u00e8":8,"stock\u00e9":6,ran:13,syntaxiqu:6,modern:[7,11],"qualit\u00e9":6,ani:[3,9,10,1],favicon:[3,9],"minifi\u00e9":8,faut:[9,7,14],expir:[3,9,10,6],have:[1,2,3,4,10,13,11],tabl:[],need:[10,4,11],allon:12,ainsi:[9,8],"priorit\u00e9":8,recharg:8,"\u00e9x\u00e9cute":12,date:9,built:2,equival:[1,8],destroi:10,rout:[7,11],"famili\u00e8r":7,port:[1,2,3,9,5,8,12,13,11],note:[5,11,2,13,12],also:[4,1,11],exampl:1,which:[1,13],seront:12,noth:10,pratiqu:9,dernier:5,parti:[9,6,7],unix_http_serv:[12,13],sure:[3,2,11],oeuvr:[],"sp\u00e9cifier":6,trace:[12,13],previou:10,compress:[1,2,3,9,5,8,12,13],defauls_set:[1,8],doit:[9,8,12],most:[13,11],plan:[5,12],pair:[1,8],sjcl_:[],"class":[4,14],charg:[9,7],get_app:[7,11],don:11,technoligi:[],commentair:6,url:[10,6],adopt:[1,8],cover:[3,13,11],doe:10,deni:[7,11],part:10,error:[1,13],"s\u00e9rieux":14,efficac:6,js_:[],gracefulli:10,personnalis:[0,14],recipi:10,wsgi:[7,11],"cr\u00e9\u00e9":7,show:1,text:[3,9],ajout:[6,14],random:10,syntax:[7,11],prix:6,server_nam:[3,9],contactez:[7,14],font:6,help:[1,8,11],xml:[3,9],fichier:[14,9,5,6,7,8,12],serait:6,toucher:9,locat:[3,9],devriez:12,menu:[1,8],configur:[1,2,3,9,5,7,8,12,13,11],apach:[0,2,3,9,5,7,11],quel:6,"cr\u00e9ation":6,theme:[0,4,14],choisi:6,"capacit\u00e9":9,templat:[4,1,8,14],wsgidaemonprocess:[7,11],gzip_buff:[3,9],local:[1,2,3,9,5,8],plate:13,disposit:[9,7],"exp\u00e9rienc":9,get:[0,1,3,6,10,12,13,11],familiar:11,"__file__":[7,11],she:10,stop:[12,13],compressed_static_fil:[1,8],bug:0,lancer:[5,7,12],mainten:[9,5],mieux:6,populair:9,a2ensit:[7,11],report:0,gen:7,requir:11,ingrat:[],nouveau:14,habituel:[9,7],enabl:11,organ:4,possibl:[3,6,11],reload:[7,1,11],stuff:[5,2],integr:4,rechargez:7,contain:[4,1],sauvegard:8,where:[4,1,2],view:[4,1,8,14],fait:[6,7],set:[1,14,3,4,7,8,13,11],fair:[9,5,6,7,12],"color\u00e9":6,automatiqu:[6,8,12],heavili:1,displai:[10,1],"\u00e9dite":9,see:[3,2],signifi:14,"recommand\u00e9":[5,7],environn:[12,13],best:[3,2,11],streambust:[],jetez:5,"pr\u00e9vention":6,still:11,kei:10,databas:0,someth:[4,1,2],easi:[10,2,11],wikipedia:[],pouvez:[5,7,14,12],bien:[9,7,14],won:[3,10,2,13,11],chemin:[9,7,8,12,14],entrant:8,propr:[9,6,8,14],lui:12,experi:3,email:[1,8],tenu:6,"int\u00e9gr\u00e9":[5,14],vaut:6,parent:[7,11],effet:9,screen:[5,2],javascript:[3,9,4,14],approxim:[1,8],dossier:[5,7,8,12,14],comm:[9,7],html5:[10,6],afffich:8,avon:[6,7],come:[10,4,2],nommez:[9,7],"pr\u00e9vu":6,protect:1,wsgiscriptalia:[7,11],last:[2,13],"support\u00e9":6,"red\u00e9marera":12,admin:[1,2,3,9,5,7,8,11],serverurl:[12,13],against:1,"re\u00e7oit":6,etc:[3,9,7,11],tout:[6,8,12],erreur:[8,12],"b\u00e9n\u00e9ficierez":[9,7],mani:13,com:[1,3,9,7,8,11],nohup:[5,2],comment:[7,10,6,1,12],"ajout\u00e9":9,assur:[9,7],"c\u00f4t\u00e9":6,"chiffr\u00e9":6,point:[10,6],color:[10,6],overview:13,address:[5,1,2,8],correspondr:9,cepend:14,header:3,essayez:[9,5],changement:9,"d\u00e9finir":12,linux:[2,3,9,5,6,10],supervisor:[0,12,13],exempl:[5,7,8],duplic:10,mailto:[1,8],save:1,fanci:10,contraint:6,coupl:4,transmet:9,copier:[6,14,12],"ajust\u00e9":8,github:[0,1,8],depui:[9,5,8,12],wsgiprocessgroup:[7,11],much:[3,10,11],"\u00e9couter":[9,8],"fonctionalit\u00e9":6,certain:[3,9,8],connait:6,"m\u00eame":[9,5,6,7],suffira:6,rpcinterface_factori:[12,13],"s\u00e9par\u00e9":9,premier:8,"am\u00e9lioron":14,fire:13,aussi:[7,8,11],imag:[1,8],gzip_proxi:[3,9],mod_cgi:[],allez:5,minifi:1,demand:7,quick:13,compressed_stat:[7,11],buld:1,"case":10,"t\u00eate":9,look:[4,1],packag:[3,11],solid:[5,7,11],"entr\u00e9":12,servic:[6,7,10,12,13,11],"appel\u00e9":8,defin:13,"while":10,couvrieron:7,behavior:1,voici:12,begin:1,aid:8,tant:[5,7,12],tourner:[9,5],css3:[10,6],"mutualis\u00e9":7,yourwebsit:[3,11],project:[3,10,11],conten:14,beaucoup:[6,7,11],site:[1,2,3,9,5,7,8,13,11],activ:[7,11],asbolut:1,soit:6,cherrypi:[10,6],lightweight:3,incom:1,complic:[],template_dir:[1,8],sever:[3,10,2,11],"g\u00e9n\u00e9rer":8,alor:6,par:[9,7,8,14],quand:[9,8],welcom:10,minim:[3,9],"d\u00e9pendant":14,nettoy:6,make:[3,10,2,13,11],shorten:10,same:11,handl:[10,2],html:[4,14],"d\u00e9chiffr":6,"\u00e9coutant":[9,7],document:0,mod_wsgi:[7,11],complet:[4,14],votresiteweb:9,"consid\u00e9r\u00e9":[],http:[1,2,3,9,5,8],bon:12,"mod\u00e9rer":6,personn:[6,2],effect:3,hand:10,director:4,moment:14,fruit:10,logfil:[12,13],improv:4,extern:3,jour:[9,6],php:[3,9],chang:3,"modifi\u00e9":8,lower:10,moder:10,paquet:[9,7],modifici:9,"h\u00f4te":8,default_set:[1,8],whole:3,"poss\u00e8d":14,"affich\u00e9":6,well:4,lequel:[8,12],retart:13,without:[3,0],command:[1,8,13,12],thi:[1,2,3,4,10,13,11],english:0,san:9,"pass\u00e9":8,voulez:8,ubuntu:[5,7,2,11],propos:7,coup:6,"g\u00e9n\u00e8re":6,identifi:6,entri:13,just:[2,3,6,4,10,12,13],less:[3,11],laptop:2,processu:[9,5,7,8,12],pourront:7,via:6,"envoy\u00e9":6,nou:[9,6,7,14,12],touch:3,connaissez:5,"al\u00e9atoir":6,yet:11,network:2,"imm\u00e9diat":9,concentr:6,web:[1,3,5,6,7,10,11],rapid:[9,8,12],sjcl:[10,6],ell:[6,7,12],apparaitra:6,apache2:[7,11],add:[4,10,1],"comment\u00e9":8,contrair:9,immediatli:3,static_files_root:[1,8],heavier:11,adress:8,app:[10,7,11],match:3,python_:[],sanit:10,applic:[3,9,6,7,11],march:[6,7],supervisord:[5,2,13,12],essayeron:6,pouvon:6,read:[10,13],big:[10,2],haut:8,"fran\u00e7ai":0,nginx:[0,2,3,9,5,7,11],moi:6,raccourcir:6,traffic:[5,2],usual:[3,1,11],background:[2,13],enrypt:[],similair:14,gestionnair:[9,7],ineffici:10,mod:[7,11],aurez:[7,14],insert:[7,11],moyen:[5,6,7,12],like:[3,11],activez:7,signal:0,"d\u00e9fini":12,"d\u00e9boguer":8,server:[3,9,10,1,11],benefit:[3,11],href:[],"id\u00e9":6,popular:3,sv1:[3,9],manag:[3,13],www:[3,9,7,11],titl:[],besoin:[6,7,14],twitter:[10,6],some:[3,10,1],"d\u00e9gradat":6,wsgiapplicationgroup:[7,11],bloqu:5,home:[1,8],sprint:[5,2],"r\u00e9pareron":6,"red\u00e9mar":9,virtualenv:[12,13],autorestart:[12,13],rien:6,est:[14,9,6,7,8,12,11],ico:[3,9],langag:6,peu:[9,6,7],prot:[9,7],octet:[1,8],conteneur:6,libapache2:[7,11],contact:[4,1,8,11],"voil\u00e0":[],onli:[3,10,1,11],avoir:[9,5,7,12],foi:[9,12],gzip_http_vers:[3,9],refer:11,"premi\u00e8r":[6,7,12],coller:6,plu:[0,9,5,6,7,8,11],throttl:[3,10,11],"prot\u00e9g\u00e9":8,burn:10,"d\u00e9compressez":5,"d\u00e9chiffrer":6,host:[1,2,3,9,5,8,10,11],wget:[5,2],habitud:9,handi:3,about:10,"syst\u00e8m":8,"\u00eatre":[9,5,6,8],decrypt:10,page:[1,8],microframework:[10,6],ceci:[7,12],rpcinterfac:[12,13],"g\u00e9ron":6,disabl:[3,9],block:2,client:[0,10,6],own:[3,4,10,1,11],consid:[],press:6,pythonpath:[12,13],"param\u00e8tr":[7,8],lien:8,automat:[10,1],son:[8,12],pastebin:[0,10,6],right:[3,1,2,11],sou:[9,5,6,7],make_main_rpcinterfac:[12,13],"import":[7,6,1,8,11],encor:[6,7],your:[1,2,3,5,4,8,11],often:3,robust:[3,10,2,11],"bugg\u00e9":6,"h\u00e9bergeur":7,wai:[10,1,2,13,11],plusieur:[9,5,6,7,12],gzip_dis:[3,9],boiler:13,support:[14,3,9,5,6,4,10,11],question:[],json:[3,9],fast:3,avail:[7,1,11],start:[1,12,13,11],zerobin:[1,2,3,4,5,6,7,8,9,10,11,12,13,14],interfac:11,includ:10,lot:[10,11],machin:13,gzip_typ:[3,9],attendr:6,"function":11,"plut\u00f4t":6,bottl:[10,6],zip:[5,2],simplement:[5,12],gzip:[3,9],verbatim:13,filet:6,fora:7,link:1,"g\u00e9n\u00e9ral":[9,8],ordinnair:8,"d\u00e9fault":14,line:[5,1],buggi:10,"true":[7,12,13,11],meilleur:[9,6],fort:[9,7],heavi:[3,11],"donn\u00e9":6,temp:[7,12],historiqu:6,"default":1,wish:[4,1,2],"d\u00e9marrer":12,access:[5,1,2],"cr\u00e9ant":7,directori:[1,7,4,12,13,11],limit:[1,9,6,7,8,10],minproc:[12,13],entendu:[9,14],sera:[5,8],similar:4,"r\u00e9sum\u00e9":12,penson:6,featur:10,"cons\u00e9quenc":6,creat:[1,3,4,10,13,11],gzip_vari:[3,9],chercher:8,request:[3,10,1,11],utilis:[0,5,6,7,8,12],"r\u00e9f\u00e9renc":7,pid:[12,13],doesn:[3,2,11],lectur:6,"cr\u00e9ez":12,dupliqu:6,ini:[12,13],file:[1,2,3,4,8,10,12,13,11],raccourcisseur:6,pip:[5,2,13,12],check:[10,2],probabl:[10,6,11],chiffrement:6,encrypt:[0,10],"pr\u00e9c\u00e9dent":6,know:[10,2,11],relatif:8,extract:2,user:[1,3,9,7,8,12,13,11],seul:7,when:[3,10,1],pidfil:[12,13],"d\u00e9but":8,ceux:14,other:[3,10],collis:[10,6],"interfa\u00e7ag":7,relativ:[],gro:[5,6],you:[1,2,3,4,10,13,11],oublier:12,servernam:[7,11],nice:13,tmp:[12,13],clipboard:10,chacun:6,norm:[7,11],souhait:8,choisir:7,developp:1,log:[10,6,12,13],gzip_comp_level:[3,9],lent:[],navigateur:[9,6],"solidit\u00e9":[9,7],"impl\u00e9ment":6,legal:10,receiv:10,lanc:[9,8],faster:1,"simplicit\u00e9":14,niveau:6,jquery_:[],temporarli:13,virtualhost:[7,11],"d\u00e9velopp":8,"pr\u00e9sent":[8,14],utilisez:14,statiqu:[9,8,14],"r\u00e9sume":12,"t\u00e9l\u00e9charger":5,time:[3,13,11],serious:10,degrad:10},objtypes:{},titles:["0bin’s documentation","Options","Easiest installation","Nginx setup","Theming","Installation la plus simple","Introduction","Installation avec Apache","Options","Installation avec Nginx","Introduction","Apache setup","Utiliser supervisor","Using supervisor","Personnaliser l’apparence"],objnames:{},filenames:["index","en/options","en/easy_install","en/nginx_install","en/theming","fr/easy_install","fr/intro","fr/apache_install","fr/options","fr/nginx_install","en/intro","en/apache_install","fr/using_supervisor","en/using_supervisor","fr/theming"]}) \ No newline at end of file diff --git a/docs/en/apache_install.rst b/docs/en/apache_install.rst index 4f47153..99f942c 100644 --- a/docs/en/apache_install.rst +++ b/docs/en/apache_install.rst @@ -2,8 +2,7 @@ Apache setup ============= -Apache is slower, heavier and more complicated to setup than Nginx. But it's also -much more famous: +Apache is heavier than Nginx. But it's also much more famous: - more people will be able to help you on forums; - your hosting will most probably support Apache; @@ -33,7 +32,65 @@ the setup of the Apache module mod_wsgi. If you don't know how to do this, or if you can't do it (E.G: your hosting won't let you), you need to go for the CGI setup. -========== +First, make sure you have mod_wsgi installed and enable by running (as admin):: -This setup is considered as slow, but you will still benefit from Apache -robustness. \ No newline at end of file + a2enmod wsgi + +This enable mod_wsgi. It it doesn't, install it first (on ubuntu, the package +is libapache2-mod-wsgi). + +Then create an Apache configuration file, usually in /etc/apache/sites-available/. +Name it zerobin:: + + + ServerName www.yourwebsite.com + + WSGIDaemonProcess zerobin user=www-data group=www-data processes=1 threads=5 + WSGIScriptAlias / /path/to/zerobin/app.wsgi + + + WSGIProcessGroup zerobin + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + + + +Activate the website (as admin):: + + a2ensite zerobin + +And reload the apache configuration (as admin):: + + service apache2 reload + +You'll note that we refer to a file named app.wsgi. It's a Python file +creating the application Apache is going to use to start the Python process:: + + import os, sys + + # make sure the zerobin module is in the PYTHON PATH and importable + ZEROBIN_PARENT_DIR = os.path.dirname(os.path.dirname(__file__)) + sys.path.insert(0, ZEROBIN_PARENT_DIR) + + # create the wsgi callable + from zerobin.routes import get_app + settings, application = get_app(compressed_static=True) + +You can of course create your own, as the `get_app` function is the only +way to pass settings to 0bin with this setup. You would do this by creating +a configuration file and passing it to the function:: + + import os, sys + + ZEROBIN_PARENT_DIR = '/path/to/zerobin/parent/dir' + sys.path.insert(0, ZEROBIN_PARENT_DIR) + + from zerobin.routes import get_app + settings, application = get_app(settings_file='/path/to/settings.py') + +CGI +=== + +You can also run 0bin using CGI, but infortunaly we didn't have time to cover +it yet. Please contact us if you ever get the need to use it. \ No newline at end of file diff --git a/docs/en/nginx_install.rst b/docs/en/nginx_install.rst index cf47a52..165652c 100644 --- a/docs/en/nginx_install.rst +++ b/docs/en/nginx_install.rst @@ -51,9 +51,51 @@ installing it. Vous must create a Nginx configuration file for 0bin. On GNU/Linux, they usually go into /etc/nginx/conf.d/. Name it zerobin.conf. -The minimal file to run the site is: +The minimal configuration file to run the site is:: -But you can make some adjustement to get better perfomances: + server { + listen 80; + server_name www.yourwebsite.com; + + location / { + proxy_pass http://127.0.0.1:8000; + } + } + +`proxy_pass` just passes the external request to the Python process. +The port much match the one used by the 0bin process of course. + +You can make some adjustements to get a better user experience:: + + server { + listen 80; + server_name www.yourwebsite.com; + + location /favicon.ico { + root /path/to/zerobin/static/img; + } + + location /static/ { + root /path/to/zerobin; + gzip on; + gzip_http_version 1.0; + gzip_vary on; + gzip_comp_level 6; + gzip_proxied any; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_buffers 16 8k; + # Disable gzip for certain browsers. + gzip_disable ~@~\MSIE [1-6].(?!.*SV1)~@~]; + expires modified +90d; + } + + location / { + proxy_pass http://zerobin_cherrypy; + } + } + +This make Nginx serve the favicon and static files, set the expire HTTP headers +and make sure gzip compression is used with browsers that support it. diff --git a/docs/en/options.rst b/docs/en/options.rst index eb1da52..9e147f4 100644 --- a/docs/en/options.rst +++ b/docs/en/options.rst @@ -1,15 +1,3 @@ - - ---host=STR - -The host on which to listen for incomming request. Usually 127.0.0.1 to -listen locally or 0.0.0.0 to listen from the outside. - -Default: 127.0.0.1 -Setting file : HOST - - - ============ Options ============ diff --git a/docs/en/theming.rst b/docs/en/theming.rst index e9b15f9..519a6e4 100644 --- a/docs/en/theming.rst +++ b/docs/en/theming.rst @@ -2,9 +2,9 @@ Theming ======= -0bin comes a complete theming support, but for now it's not well ingrated. +0bin comes with a complete theming support, but for now it's not well integrated. -If you wish to create your own theme, you'll need to create template similar +If you wish to create your own theme, you'll need to create templates similar to the ones in zerobin/view, and add the path to the director containing them to the settings file. diff --git a/docs/en/using_supervisor.rst b/docs/en/using_supervisor.rst index 2e9df84..c55824e 100644 --- a/docs/en/using_supervisor.rst +++ b/docs/en/using_supervisor.rst @@ -1,3 +1,72 @@ -==================== +================= Using supervisor -==================== \ No newline at end of file +================= + +Supervisor is a very nice way to manage you Python processes. We won't cover +the setup (which is just apt-get install supervisor or pip install supervisor +most of the time), but here is a quick overview on how to use it. + +Create a configuration file named supervisor.ini:: + + [unix_http_server] + file=/tmp/supervisor.sock; + + [supervisorctl] + serverurl=unix:///tmp/supervisor.sock; + + [rpcinterface:supervisor] + supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface + + [supervisord] + logfile=/tmp/zerobin.log + logfile_maxbytes=50MB + logfile_backups=2 + loglevel=trace + pidfile=/tmp/supervisord.pid + nodaemon=false + minfds=1024 + minprocs=200 + user=zerobin + + [program:zerobin] + command=/path/to/zerobin/zerobin.py --port 80 --compressed-static + directory=/path/to/zerobin/ + environment=PYTHONPATH='/path/to/zerobin/' + user=zerobin + autostart=true + autorestart=true + +The 4 first entries are just boiler plate to get you started, you can copy +them verbatim. + +The last one define one (you can have many) process supervisor should manage. + +It means it will run the command:: + + /path/to/zerobin/zerobin.py --port 80 --compressed-static + +In the directory, with the environnement and the user you defined. + +This command will be ran as a daemon, in the background. + +`autostart` and `autorestart` just make it fire and forget: the site will always be +running, even it crashes temporarly or if you retart the machine. + +The first time you run supervisor, pass it the configuration file:: + + supervisord -c /path/to/supervisor.ini + +Then you can manage the process by running:: + + supervisorctl -c /path/to/supervisor.ini + +It will start a shell from were you can start/stop/restart the service + +You can read all errors that might occurs from /tmp/zerobin.log. + +.. Note:: + + If you installed zerobin in a virtualenv, you may set the command + to run directly from it:: + + command=/path/to/virtualenv/bin/zerobin --port 80 --compressed-static \ No newline at end of file diff --git a/docs/fr/apache_install.rst b/docs/fr/apache_install.rst index 230b736..ce8ed72 100644 --- a/docs/fr/apache_install.rst +++ b/docs/fr/apache_install.rst @@ -2,8 +2,7 @@ Installation avec Apache ========================= -Apache est plus lent, plus lourd, et plus complexe à mettre en oeuvre que Nginx. -Mais il est aussi beaucoup plus connu: +Apache est plus lourd que Nginx mais il est aussi beaucoup plus connu: - plus de gens pourront vous aider les fora; - votre hébergeur propose surement Apache; @@ -34,9 +33,67 @@ l'installation du modle Apache mod_wsgi. Si vous ne savez pas comment faire, ou si vous ne pouvez pas le faire (par exemple sur un hébergement mutualisé qui ne le propose pas), il vous faudra choisir l'installation CGI. +Premièrement, assurez-vous d'avoir mod_wsgi installé et chargé (en tant qu'admin):: -Mod_CGI -========== + a2enmod wsgi + +Ceci va activer mod_wsgi. Si cela ne marche pas, il faudra l'installer d'abord ( +sur ubuntu, le paquet est libapache2-mod-wsgi) + +Ensuite, il faut créer un fichier de configuration Apache, généralement dans +/etc/apache/sites-available/. Nommez le zerobin:: + + + ServerName www.votersiteweb.com + + WSGIDaemonProcess zerobin user=www-data group=www-data processes=1 threads=5 + WSGIScriptAlias / /chemin/vers/zerobin/app.wsgi + + + WSGIProcessGroup zerobin + WSGIApplicationGroup %{GLOBAL} + Order deny,allow + Allow from all + + + +Activez le site web (en tant qu'admin):: + + a2ensite zerobin + +Et rechargez la configuration d'Apache (en tant qu'admin):: + + service apache2 reload + +Vous aurez noté que l'on fait référence à un fichier nommé app.wsgi. C'est un +fichier Python qui créé l'application qu'Apache va utiliser pour lancer le +processus Python:: + + import os, sys + + # s'assurer que le module zerobin est dans le PYTHON PATH et importable + ZEROBIN_PARENT_DIR = os.path.dirname(os.path.dirname(__file__)) + sys.path.insert(0, ZEROBIN_PARENT_DIR) + + # créer le wsgi callable + from zerobin.routes import get_app + settings, application = get_app(compressed_static=True) + +Vous pouvez bien sûr créer le votre, puisque la fonction `get_app` et le seul +moyen de passer des paramètres à 0bin avec cette installation. Cela peut se +faire en créant un fichier de configuration et en le passant à la fonction:: + + import os, sys + + ZEROBIN_PARENT_DIR = '/chemin/du/dossier/parent/de/zerobin' + sys.path.insert(0, ZEROBIN_PARENT_DIR) + + from zerobin.routes import get_app + settings, application = get_app(settings_file='/path/to/settings.py') + +CGI +=== + +Vous pouvez aussi utiliser CGI, mais nous n'avons pas encore eu le temps de +couvrir cette partie. Contactez nous si vous avez besoin de l'utiliser. -Cette installation est considérée comme relativement lente. Mais vous bénéficierez -tout de même de la robustesse d'Apache \ No newline at end of file diff --git a/docs/fr/nginx_install.rst b/docs/fr/nginx_install.rst index e7f1f89..038df8f 100644 --- a/docs/fr/nginx_install.rst +++ b/docs/fr/nginx_install.rst @@ -55,10 +55,53 @@ nous ne couvrirons pas cette partie. Vous devez créer une fichier de configuration Nginx pour 0bin. Sous GNU/Linux, on les mets en général dans /etc/nginx/conf.d/. Nommez le zerobin.conf. -Le fichier minimal pour faire tourner le site est: - -Mais on peut apporter plusieurs améliorations de performance: +Le fichier de configuration minimal pour faire tourner le site est:: + server { + listen 80; + server_name www.votresiteweb.com; + + location / { + proxy_pass http://127.0.0.1:8000; + } + } + +`proxy_pass` transmet les requêtes aux processus Python. Bien entendu le +port doit correspondre à celui utilisé par 0bin. + +On peut apporter plusieurs améliorations à l'expérience utilisateur:: + + server { + listen 80; + server_name www.votresiteweb.com; + + location /favicon.ico { + root /chemin/vers/zerobin/static/img; + } + + location /static/ { + root /chemin/vers/zerobin; + gzip on; + gzip_http_version 1.0; + gzip_vary on; + gzip_comp_level 6; + gzip_proxied any; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_buffers 16 8k; + # Disable gzip for certain browsers. + gzip_disable ~@~\MSIE [1-6].(?!.*SV1)~@~]; + expires modified +90d; + } + + location / { + proxy_pass http://zerobin_cherrypy; + } + } + +Nginx sert maintenant le favicon ainsi que les fichiers statiques, +on a ajouté une date d'expiration dans les en-têtes HTTP +et on s'assure que la compression gzip est utilisée pour les navigateurs +qui la supporte. diff --git a/docs/fr/using_supervisor.rst b/docs/fr/using_supervisor.rst index 4b90a8b..a357fc7 100644 --- a/docs/fr/using_supervisor.rst +++ b/docs/fr/using_supervisor.rst @@ -1,3 +1,75 @@ ==================== Utiliser supervisor -==================== \ No newline at end of file +==================== + +Supervisor est un très bon moyen de gérer des processus Python. Nous n'allons +pas couvrir son installation (qui la plupart du temps se résume à +apt-get install supervisor ou pip install supervisor), mais voici un rapide +résumé de comment l'utiliser: + +Créez un fichier de configuration nommé supervisor.ini:: + + [unix_http_server] + file=/tmp/supervisor.sock; + + [supervisorctl] + serverurl=unix:///tmp/supervisor.sock; + + [rpcinterface:supervisor] + supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface + + [supervisord] + logfile=/tmp/zerobin.log + logfile_maxbytes=50MB + logfile_backups=2 + loglevel=trace + pidfile=/tmp/supervisord.pid + nodaemon=false + minfds=1024 + minprocs=200 + user=zerobin + + [program:zerobin] + command=/chemin/vers/zerobin/zerobin.py --port 80 --compressed-static + directory=/chemin/vers/zerobin/ + environment=PYTHONPATH='/chemin/vers/zerobin/' + user=zerobin + autostart=true + autorestart=true + +Les 4 premières entrées sont juste de la configuration standard et vous pouvez +les copier telles qu'elles. + +La dernière entrée définie un processus (il peut y en avoir plusieurs) +que supervisor doit gérer. + +Cela veut dire qu'il va lancer la commande:: + + /chemin/vers/zerobin/zerobin.py --port 80 --compressed-static + +Et ceci dans le dossier, avec l'environnement et l'utilisateur défini, le tout +en arrière plan en tant que daemon. + +`autostart` et `autorestart` permettent simplement de le lancer et de l'oublier: +supervisor redémarera le processus automatiquement en cas d'arrêt impromptu. + +La première fois que vous lancez supervisor, passez lui le fichier de configuration:: + + supervisord -c /chemin/vers/supervisor.ini + +Ensuite vous pouvez gérer les processus avec:: + + supervisorctl -c /chemin/vers/supervisor.ini + +Cela va démarrer un shell depuis lequel vous pouvez faire un start/stop/restart +sur le service. + +Toutes les erreurs seront logguées dans /tmp/zerobin.log. + + +.. Note:: + + Si vous avez installé zerobin dans un virtualenv, vous devriez définir la + commande pour qu'elle s'éxécute depuis le virtualenv:: + + command=/chemin/vers/le/virtualenv/bin/zerobin --port 80 --compressed-static \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 3ef5a74..4a7d7db 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -27,12 +27,5 @@ +-------------------------+--------------------------------+ -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - .. _Signaler un bug: https://github.com/sametmax/0bin/issues .. _Report a bug: \ No newline at end of file diff --git a/zerobin/app.wsgi b/zerobin/app.wsgi new file mode 100644 index 0000000..ff42952 --- /dev/null +++ b/zerobin/app.wsgi @@ -0,0 +1,10 @@ + +import os, sys + +# make sure the zerobin module is in the PYTHON PATH and importable +ZEROBIN_PARENT_DIR = os.path.dirname(os.path.dirname(__file__)) +sys.path.insert(0, ZEROBIN_PARENT_DIR) + +# create the wsgi callable +from zerobin.routes import get_app +settings, application = get_app(compressed_static=True) \ No newline at end of file diff --git a/zerobin/routes.py b/zerobin/routes.py index 78466a6..681b569 100644 --- a/zerobin/routes.py +++ b/zerobin/routes.py @@ -111,23 +111,14 @@ def server_static(filename): return static_file(filename, root=settings.STATIC_FILES_ROOT) -@clize.clize(coerce={'debug': bool, 'compressed_static': bool}) -def runserver(host='', port='', debug=None, user='', - group='', settings_file='', compressed_static=None, version=False): - - if version: - print '0bin V%s' % settings.VERSION - sys.exit(0) - - # merge the settings +def get_app(debug=None, settings_file='', compressed_static=None): + """ + Return a tuple (settings, app) configured using passed options and + a setting file. + """ if settings_file: settings.update_with_file(os.path.abspath(settings_file)) - settings.HOST = host or settings.HOST - settings.PORT = port or settings.PORT - settings.USER = user or settings.USER - settings.GROUP = group or settings.GROUP - if compressed_static is not None: settings.COMPRESSED_STATIC_FILES = compressed_static @@ -138,12 +129,32 @@ def runserver(host='', port='', debug=None, user='', for d in reversed(settings.TEMPLATE_DIRS): bottle.TEMPLATE_PATH.insert(0, d) + if settings.DEBUG: + bottle.debug(True) + + return settings, app + + +@clize.clize(coerce={'debug': bool, 'compressed_static': bool}) +def runserver(host='', port='', debug=None, user='', + group='', settings_file='', compressed_static=None, version=False): + + settings, app = get_app(debug, settings_file, compressed_static) + + if version: + print '0bin V%s' % settings.VERSION + sys.exit(0) + + settings.HOST = host or settings.HOST + settings.PORT = port or settings.PORT + settings.USER = user or settings.USER + settings.GROUP = group or settings.GROUP thread.start_new_thread(drop_privileges, (settings.USER, settings.GROUP)) if settings.DEBUG: - bottle.debug(True) - run(app, host=settings.HOST, port=settings.PORT, reloader=True, server="cherrypy") + run(app, host=settings.HOST, port=settings.PORT, reloader=True, + server="cherrypy") else: run(app, host=settings.HOST, port=settings.PORT, server="cherrypy")