a little bug I found (and corrected) is that if you comment out 
ssl_certificate and ssl_private_key, that parameter is missing, and web2py 
requires it. If you don't need certificates just set ssl_certificate and 
ssl_private_key to None (as current trunk options_std.py 
http://code.google.com/p/web2py/source/browse/options_std.py)

second thing, I think the interface for ws2008 changed a little bit, so 
it's not possible to use cmdline parameter to start the service (try 
running the shell as administrator, could help). If it doesn't, just use 
the "windows usual flavour" 
net start nameoftheservice
to start it.

Another thing, you have parameters_* files for ports 8000 and 442 but you 
start the service for 8000 and 443. I don't have a ws2008 installation 
available to test it, but you can try with these hints. 

Not too long ago I proposed to strip off the code of the windows webservice 
cause it's getting harder and harder to maintain. Useful tools as nssm are 
a lot easier to deal with and can make virtually any programs run as 
services with no issues (and I could make a slice for it if users need it).

On Wednesday, September 5, 2012 5:29:06 PM UTC+2, Geo wrote:
>
>
> Greetings,
> I have searched similar posts but I still can't make it work.
>
> I have a test machine with the following configuration:
> - Windows Server 2008 R2 Standard 64
> - python 2.7
>     - pywin32_system32
>     - OpenSSL
> - web2py source 1.99.7 (2012-03-04 22:12:08) stable
>
> options.py:
> import socket
> import os
>
> ip = socket.gethostbyname(socket.gethostname())
> port = 8000
> interfaces=[(ip,port)]
> interfaces.append((ip,443,'server.key','server.crt'))
> password = '<recycle>'  # ## <recycle> means use the previous password
> pid_filename = 'httpserver.pid'
> log_filename = 'httpserver.log'
> profiler_filename = None
> #ssl_certificate = 'server.crt'  # ## path to certificate file
> #ssl_private_key = 'server.key'  # ## path to private key file
> minthreads = None
> maxthreads = None
> server_name = socket.gethostname()
> request_queue_size = 5
> timeout = 30
> shutdown_timeout = 5
> folder = os.getcwd()
> extcron = None
> nocron = None
>
> additional files:
> parameters_442.py
> parameters_8000.py
>
> all works when started by command line (python 
> web2py.py--password="<recycle>" --
> config=options.py) but when I try to start it as a service I get mixed 
> results.
> if I comment the lines
> #ssl_certificate = 'server.crt'  # ## path to certificate file
> #ssl_private_key = 'server.key'  # ## path to private key file
> the service does not start and in the event logger I get:
>
> Traceback (most recent call last): File "D:\web2py\gluon\winservice.py", 
> line 49, in SvcDoRun self.start() File "D:\web2py\gluon\winservice.py", 
> line 122, in start ssl_certificate=options.ssl_certificate, AttributeError: 
> 'module' object has no attribute 'ssl_certificate' 
>
> if I uncomment the lines
> ssl_certificate = 'server.crt'  # ## path to certificate file
> ssl_private_key = 'server.key'  # ## path to private key file
>
> the service starts but I cannot connect to the pages
>
> Also, if I try to start the service from command line (--winservice=start) 
> instead than from the services pannel, the sytem returns "Error starting 
> service: Access is denied."
>
> Can anyone help me?
>
> Thanks
>

-- 



Reply via email to