Run Microbe

Command

Microbe comes with the command microbe. This command has several subcommands to easily manage your application (see API part for more information).

One of these launch a CherryPy server to serve the application : runserver.

If you have installed it in a virtualenv you need to prefix it with your virtualenv path : $PATH_TO_VIRTUALENV/bin/microbe.

$ microbe runserver
-i, --ip

determine the host to serve the application (default=127.0.0.1)

-p, --port

determine the port to serve the application (default=8000)

-u, --url

determine the url to serve the application (default=/)

That’s it, Microbe now run on the port given in argument you can then access it at http://ip:port/url/

Run in background

Microbe does not come with something build for this. You have several solutions.

Shell background process

To run a command in background you can run it in a shell background process with nohup

$ nohup microbe [-options]

Or run it in a screen

$ screen
$ microbe [-options]

Press Ctrl + A then d. Your session keep going on in background.

Supervisor

Supervisor is a program to manage processes, it can be easily installed using your package manager or pip.

Create a configuration file /etc/supervisor/conf.d/microbe.conf

[program:microbe]
command=microbe [-options]
directory=/path-to-home/
environment=HOME='/path-to-home/'
autostart=true
autorestart=true

Then you need to enable your config file using as root

# supervisorctl update
# supervisorctl start microbe