linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -


my group , running server based upon django , uses mod_wsgi run apache server. not working on project after over, attempting set cronjob similar functionality check if apache server has shut down(system restart or power failure), , if has, restart server me. i've found documentation on how check if apache server down , restart server if is, our server uses https , our start command pretty verbose.

can use functionality provided in these examples:

https://askubuntu.com/questions/277389/cron-job-to-restart-apache

https://www.digitalocean.com/community/tutorials/how-to-use-a-simple-bash-script-to-restart-server-programs

or need more complicated process make happen?

the command use start server is

python manage.py runmodwsgi --host 0.0.0.0 --port 8001 --https-port 8000 --ssl-certificate (certificate location) --server-name (domain name)

i'm pretty new linux , using both mod-wsgi apache appreciated.

you better off using --setup-only option mod_wsgi-express or django integration it, generate configuration not run it. others have mentioned, integrate system service manager.

the 2 commands starting , stopping apache/mod_wsgi instance apachectl start , apachectl stop, apachectl generated when running additional --setup-only option.

when running system service, make sure use --server-root option specify more persistent location generated configuration. not use default under /tmp if running temporary development sessions linux systems remove files under /tmp causing things start failing after while.

also, since under service manager starting root, particularly if listening on port 80 requirement, ensure use --user , --group options specify user/group python web application should run as.

read:

for more details of --setup-only option , start-server commands generating configuration. because using django integration, need use --setup-only option.

for more informed helped, bring issue mod_wsgi mailing list. mod_wsgi-express way of running apache/mod_wsgi new enough unlikely here going know it.


Comments

Popular posts from this blog

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -