sudo apt-get install python3-dev
sudo apt-get install python3-setuptools
sudo apt-get install python3-kivy
wget 'https://bootstrap.pypa.io/get-pip.py'
python get-pip.py
sudo pip install uwsgi
Now we need to create the vassals folder, which is the folder where our .ini
files (called vassals) will reside upon.
Inside vassals we will have two other folders: available
and enabled
. The first will contain all the (.ini)
configuration files. While the second (enabled
) will contain a symlink to the files at available
.
1:
cd /etc/
2:
sudo mkdir uwsgi
3:
cd uwsgi
4:
sudo mkdir vassals
5:
cd vassals
6:
sudo mkdir enabled
7:
sudo mkdir available
Now we need to create an emperor.ini
file, which will contain the path for the other vassals at enabled
:
sudo nano /etc/uwsgi/vassals/emperor.ini
Add this to the file:
[uwsgi]
emperor = /etc/uwsgi/vassals/enabled
###Now, it's time to deamonize uwsgi. In order to do it, create a usgi.service
file at /etc/systemd/system/
:
sudo nano /etc/systemd/system/uwsgi.service
Now, paste the following content into it:
[Unit]
Description=uWSGI Emperor
After=syslog.target
[Service]
ExecStart=/usr/local/bin/uwsgi --ini /etc/uwsgi/vassals/emperor.ini
# Requires systemd version 211 or newer
RuntimeDirectory=uwsgi
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all
[Install]
WantedBy=multi-user.target
Save the file, and run the following commands:
- To start the service
sudo systemctl start uwsgi
- Check that it started without issues by typing:
systemctl status uwsgi
- If there were no errors, enable the service so that it starts at boot by typing:
sudo systemctl enable uwsgi
- If there were no errors, enable the service so that it starts at boot by typing:
sudo systemctl stop uwsgi
[uwsgi]
# Path to the virtualenv folder
home = /home/maumau/.virtualenvs/sendmail
#socket = 127.0.0.1:8000
socket = /tmp/sendmail.sock
uid = www-data
gid = www-data
processes = 5
#harakiri=20
#max-requests=1000
#vacum=True
chmod-socket = 666
buffer-size=32768
# Esta a pasta do projeto
# Django project root (manage.py)
chdir = /home/maumau/webapps/sendmail
logto = /var/log/uwsgi/sendmail.log
module = sendmail.wsgi
What's the purpose of python3-kivy here?