> On 3 Aug 2017, at 5:30 PM, Anupam <[email protected]> wrote:
> 
> I have successfully set up a web application on production server using 
> mod_wsgi-express and slowly learning, with hit and trial, how to make the 
> command (and arguments) to start the server, more useful and efficient. This 
> is what I have so far and would be happy to get feedback on:
> 
> nohup mod_wsgi-express start-server --application-type module mysitename.wsgi 
> --server-root /etc/mod_wsgi-80 --reload-on-changes &
> 
> I ssh into a Google Compute Engine which disconnects after sometime (also 
> terminating all processes started during that session) so using nohup and 
> using '&' at the end so it runs as a background process. Using server-root so 
> as not to rely on the tmp directory. (Also, hope using reload-on-changes here 
> is ok (in the examples I saw it being used mostly with runmodwsgi).
> 
> If I ever need to stop the server, I find the process (ps -ef | grep 
> mod_wsgi) and kill it. There are a number of processes that come up and 
> killing the first one kills the others too.

You are better off running:

    mod_wsgi-express setup-server --application-type module mysitename.wsgi 
--server-root /etc/mod_wsgi-80 

IOW, use 'setup-server', rather than 'start-server'.

This will generate the configuration files and startup scripts.

Then use:

    /etc/mod_wsgi-80/apachectl start

to start it as a daemon.

Then use:

    /etc/mod_wsgi-80/apachectl stop

to stop it.

That way you don't need to use nohup or background it yourself.

Use of --reload-on-changes can be used in that way but is not recommended for 
production environments.

For more details see section 'Running mod_wsgi-express as root' of:

    https://pypi.python.org/pypi/mod_wsgi 
<https://pypi.python.org/pypi/mod_wsgi>

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to