Below is an excerpt from the book -- please note that you should also look 
at the -L option:

if you run web2py as Windows Service, -W, it is not convenient to pass the 
configuration using command line arguments. For this reason, in the web2py 
folder there is a sample "options_std.py" configuration file for the 
internal web server:

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.

import socket
import os

ip = '0.0.0.0'
port = 80
interfaces=[('0.0.0.0',80)]
#interfaces.append(('0.0.0.0',443,'ssl_private_key.pem','ssl_certificate.pem'))
password = '<recycle>'  # ## <recycle> means use the previous password
pid_filename = 'httpserver.pid'
log_filename = 'httpserver.log'
profiler_filename = None
minthreads = None
maxthreads = None
server_name = socket.gethostname()
request_queue_size = 5
timeout = 30
shutdown_timeout = 5
folder = os.getcwd()
extcron = None
nocron = None

This file contains the web2py defaults. If you edit this file, you need to 
import it explicitly with the -L command-line option. It only works if you 
run web2py as a Windows Service.



On Friday, August 17, 2012 1:33:55 PM UTC+1, mcamel wrote:
>
> I've just join the group today searching for the answer to the same 
> problem as you.
>
> I've read dozens of post and will try some of this:
>
>    - at the en of this post 
>    
> https://groups.google.com/forum/?fromgroups#!searchin/web2py/service$20windows/web2py/j-NT5gsMasE/SQV3g-kHHp8J[1-25]is
>  described a posible solution
>    - others talk about the need to install Mark Hammond's Win32 
>    Extensions, though it seems if for another service problem (not the 
> timeout 
>    one we both have): http://starship.python.net/~skippy/win32/ 
>    http://python.net/crew/mhammond/win32/Downloads.html
>    - some wrote that password='<recycle>' should be written in Window 
>    like password="<recycle>"
>    
>
> BTW: I'm trying at W2000Professional and W2000Server.
>
>
> On Tuesday, May 15, 2012 11:15:38 PM UTC+2, Fernando Macedo wrote:
>>
>> Hello all, I need some help on this.
>>
>> I'm trying to distribute my app as an exe file, and it should run as a 
>> windows service.
>>
>> Tested on trunk an also with windows binary distro. 
>>
>> The web2py was registered as windows service, but don't starts.
>>
>> D:\web2py_win>web2py.exe -W install
>>>>
>>> web2py Web Framework
>>>
>>> Created by Massimo Di Pierro, Copyright 2007-2011
>>>
>>> Version 1.99.7 (2012-03-04 22:12:08) stable
>>>
>>> Database drivers available: SQLite3, pymysql, pg8000, IMAP
>>>
>>> Starting hardcron...
>>>
>>> Installing service web2py
>>>
>>> Changing service configuration
>>>
>>> Service updated
>>>
>>>
>>>> D:\web2py_win>web2py.exe -W start
>>>
>>> web2py Web Framework
>>>
>>> Created by Massimo Di Pierro, Copyright 2007-2011
>>>
>>> Version 1.99.7 (2012-03-04 22:12:08) stable
>>>
>>> Database drivers available: SQLite3, pymysql, pg8000, IMAP
>>>
>>> Starting hardcron...
>>>
>>> Starting service web2py
>>>
>>> Error starting service: O serviþo nÒo respondeu Ó requisiþÒo de inÝcio 
>>>> ou contro
>>>
>>> le em tempo hßbil.
>>>
>>>
>>>> D:\web2py_win>
>>>
>>>
>> I got the error "Erro 1053: O serviço não respondeu à requisição de 
>> início ou controle em tempo hábil.", It's from Windows Os (in portuguese), 
>> something like "Error 1053: The service did not respond to the start or 
>> control request in a timely manner".
>>
>>
>> options.py as default:
>>
>>
>>>    1. #!/usr/bin/python
>>>    2. # -*- coding: utf-8 -*-
>>>    3.  
>>>    4. # when web2py is run as a windows service (web2py.exe -W)
>>>    5. # it does not load the command line options but it
>>>    6. # expects to find conifguration settings in a file called
>>>    7. #
>>>    8. #   web2py/options.py
>>>    9. #
>>>    10. # this file is an example for options.py
>>>    11.  
>>>    12. import socket
>>>    13. import os
>>>    14.  
>>>    15. ip = '0.0.0.0'
>>>    16. port = 80
>>>    17. interfaces=[('0.0.0.0',80),('0.0.0.0',443,'ssl_private_key.pem',
>>>    'ssl_certificate.pem')]
>>>    18. password = '<recycle>'  # ## <recycle> means use the previous 
>>>    password
>>>    19. pid_filename = 'httpserver.pid'
>>>    20. log_filename = 'httpserver.log'
>>>    21. profiler_filename = None
>>>    22. #ssl_certificate = 'ssl_certificate.pem'  # ## path to 
>>>    certificate file
>>>    23. #ssl_private_key = 'ssl_private_key.pem'  # ## path to private 
>>>    key file
>>>    24. #numthreads = 50 # ## deprecated; remove
>>>    25. minthreads = None
>>>    26. maxthreads = None
>>>    27. server_name = socket.gethostname()
>>>    28. request_queue_size = 5
>>>    29. timeout = 30
>>>    30. shutdown_timeout = 5
>>>    31. folder = os.getcwd()
>>>    32. extcron = None
>>>    33. nocron = None
>>>    
>>>
>> Any adeas?
>>
>> Thanks in advance,
>> Fernando Macedo
>>
>

-- 



Reply via email to