Web2py não inicia em modo de serviço no Windows

81 views
Skip to first unread message

Rodrigo Moraes

unread,
Jun 25, 2011, 10:36:18 PM6/25/11
to web2py-users-brazil
Boa noite pessoal,tenho uma dúvida em relação a configuração do web2py
no windows seguindo
o manual. Eu instalei o Apache, extensão, Mysql, enfim tudo, e
instalei ele com o comando "python web2py.py -W install", apareceu lá
no services.msc do windows, mas quando dou o comando "python web2py.py
-W start", nada acontece, e quando inicio direto no mmc do services,
ele dá um erro, diz que não há comandos a serem executados.
Seŕa que alguem conseguiu iniciar em modo de serviço o web2py?

qualquer ajuda é bem vinda..... Obrigado.

Fernando Macedo

unread,
May 15, 2012, 4:09:05 PM5/15/12
to web2py-us...@googlegroups.com
Olá Rodrigo, algum resultado nesta batalha?

Estou tentando fazer funcionar para ver se vale a pena investir nesta configuração.

A minha necessidade é distribuir o app como um executável, e o app deve rodar como um serviço no windows.

Fiz o teste com a versão do código fonte (trunk), e com a distribuição windows (binários), e não funciona.

Microsoft Windows [versão 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.

C:\Windows\system32>cd D:\webconn\web2py_win\web2py

C:\Windows\system32>d:

D:\webconn\web2py_win\web2py>web2py.exe -W install
New installation: unable to create welcome.w2p fileweb2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 2.00.0 (2012-05-15 09:05:35) dev
Database drivers available: SQLite3, pymysql, pg8000, MSSQL/DB2/Teradata, mongoD
B, IMAP
Starting hardcron...
Installing service web2py
Changing service configuration
Service updated

D:\webconn\web2py_win\web2py>cd ..

D:\webconn\web2py_win>cd ..

D:\webconn>cd ..

D:\>cd web2py_win

D:\web2py_win>python web2py.exe -W install
  File "web2py.exe", line 1
SyntaxError: Non-ASCII character '\x90' in file web2py.exe on line 1, but no enc
oding declared; see http://www.python.org/peps/pep-0263.html for details

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>

O serviço aparece como instalado, mas ao tentar iniciá-lo recebo a mensagem "Erro 1053: O serviço não respondeu à requisição de início ou controle em tempo hábil."

O options.py está no padrão:

  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

Alguma idéia?

Obrigado,
Fernando Macedo
Reply all
Reply to author
Forward
0 new messages