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
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