Systemctl

From ElectroDragon Wiki

Uwsgi

  • nano /etc/systemd/system/uwsgi1.service
  • add config file below
  • or systemctl start uwsgi1
  • sudo systemctl start my_app


# Check the status
  • sudo systemctl status my_app.service
# You should be able to see the socket with
  • ls /var/www/html/flask-test/sock.sock -> # /var/www/html/my_app/my_app.sock
# Enable it on startup
  • sudo systemctl enable uwsgi1


[Unit]

Description="uWSGI server instance for my_app"
After=network.target

[Service]
User=www-data
Group=www-data
WorkingDirectory=/var/www/html/flask-test/
Environment=FLASK_ENV=test
ExecStart=/usr/local/bin/uwsgi --ini /var/www/html/flask-test/conf.ini

[Install]
WantedBy=multi-user.target