3👍
Looks like the question is about Ubuntu systemd launcher rather than django + mod_wsgi…
After struggling with init.d scripts, I have moved over to systemd service file:
/lib/systemd/system/apache_mod_wsgi.service
[Unit]
Description=apache2 with mod_wsgi
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/etc/mod_wsgi-express-80/apachectl start
ExecStop=/etc/mod_wsgi-express-80/apachectl stop
[Install]
WantedBy=multi-user.target
With this file saved, I killed the native apache2 service and enabled the new service…
f*kuda@ubuntu:~% sudo update-rc.d apache2 remove
f*kuda@ubuntu:~% sudo systemctl enable apache_mod_wsgi.service
f*kuda@ubuntu:~% sudo reboot
The daemons have started successfully, and the django application seems working properly (that is, is responding in an exactly same manner with “manually started” version and the development server.
The only concern is that dmesg would not report the starting up of the service.
0👍
If you searched for how to start a mod_wsgi-express
with init.d or the likes instead of with django, first have a look at https://pypi.python.org/pypi/mod_wsgi#running-mod-wsgi-express-as-root.
you should use setup-server:
mod_wsgi-express setup-server wsgi.py --port=80 \ --user www-data --group www-data \ --server-root=/etc/mod_wsgi-express-80
This should be the prerequisite to OP’s answer.