nssm and web2py as a windows service

163 views
Skip to first unread message

Rod Watkins

unread,
Mar 3, 2015, 2:23:19 PM3/3/15
to web...@googlegroups.com
Hi everyone,

Could someone share with me their nssm configuration to run web2py on port 80 and port 443 with ssl on windows?

I've tried to follow the book as well as researching here for fixes, but have had no luck. Either the service fails to load or if it does, I cannot connect.

Thanks for your time.

Rod


Niphlod

unread,
Mar 3, 2015, 2:43:03 PM3/3/15
to web...@googlegroups.com
nssm isn't rocket science, from the web2py perspective.
The point usually is being able to run web2py passing arguments as you need them ?
If you can do it by cmdline, nssm isn't an issue: just use the same commandline

web2py.py -a "<recycle>" --interfaces "0.0.0.0:80;0.0.0.0:443:path_to_key:path_to_cert"

should suffice for most cases.

Tim Richardson

unread,
Mar 3, 2015, 6:46:50 PM3/3/15
to web...@googlegroups.com
... so first let us know if you have a working command line version of what you want to do. 

nssm is easy after that. 

Rod Watkins

unread,
Mar 4, 2015, 2:41:24 PM3/4/15
to web...@googlegroups.com
Thanks Niphlod. i had a silly typo i kept missing. Got it working great. 
rod

Niphlod

unread,
Mar 4, 2015, 2:52:20 PM3/4/15
to web...@googlegroups.com
^_^ . Glad it worked out fine. @tim: maybe a PR on the book with this cmdline instead of the one posted there

c:\web2py.py -p 8041 -i "0.0.0.0" --password="112233" --folder="d:\web2py_internet" --socket-timeout=10 --timeout=120 -c "d:\web2py_internet\applications\example.com.au.crt" -k "d:\web2py_internet\applications\web2py.key



that is a taddle bit:
-  long
- unreadable
- for a pretty uncommon setup (web2py.py on c:\ ?!?)

would be beneficial.
something among the lines of

web2py.py (or web2py.exe) -a "<recycle>" --interfaces "0.0.0.0:80"  <-- to run HTTP only
and
web2py.py (or web2py.exe) -a "<recycle>" --interfaces "0.0.0.0:80;0.0.0.0:443:c:\path_to_key.key:c:\path_to_cert.crt" <-- to run HTTP and HTTPS

what do you say ?

Reply all
Reply to author
Forward
0 new messages