python - How to autostart apachectl script that mod_wsgi-express made for django? -
i'm working on web application based on django-1.8.2 , on virtual env provided python-3.4.3 of ubuntu-15.04.
my app. working on development server, , has been deployed using mod_wsgi-4.4.11 (pip installed) , ubuntu's apache. is, after collecting static files , modify file permissions of db.sqlite3, did ...
% sudo ../bin/python manage.py runmodwsgi --setup-only --port=80 --user www-data --group www-data --server-root=/etc/mod_wsgi-express-80
% sudo /etc/mod_wsgi-express-80/apachectl start
to have working server.
i'd daemons start on boot-up automatically, have no luck in writing init.d script or config file. probably, utterly new way required systemd of 15.04. suggestions welcome.
looks question ubuntu systemd launcher rather django + mod_wsgi...
after struggling init.d scripts, have moved on systemd service file:
/lib/systemd/system/apache_mod_wsgi.service
[unit] description=apache2 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 file saved, killed native apache2 service , enabled new service...
fukuda@ubuntu:~% sudo update-rc.d apache2 remove fukuda@ubuntu:~% sudo systemctl enable apache_mod_wsgi.service fukuda@ubuntu:~% sudo reboot
the daemons have started successfully, , django application seems working (that is, responding in same manner "manually started" version , development server.
the concern dmesg not report starting of service.
Comments
Post a Comment