Quijost

Por favor ingresa o regístrate.

Ingresar con nombre de usuario, contraseña y duración de la sesión
Búsqueda Avanzada  

Noticias:

Deja tu post en el foro para hacer algun tipo de consulta

Autor Tema: web2py?  (Leído 15851 veces)

0 Usuarios y 1 Visitante están viendo este tema.

genes

  • Usuario nuevo
  • *
  • Karma: +0/-0
  • Desconectado Desconectado
  • Mensajes: 4
    • Ver Perfil
web2py?
« en: Abril 23, 2010, 01:24:59 am »

El servidor tiene mod_wsgi, por lo que seria posible instalar web2py. Pero no se como hacerlo, porque el tutorial que tengo de que hay que modificar el archivo de configuración de Apache, cosa que entiendo que no puedo hacer.
Aca está el tutorial:
http://web2py.com/book/default/section/11/2
Saludos,
SB.
En línea

shakaran

  • Soporte
  • Administrator
  • Usuario profesional
  • *****
  • Karma: +12/-0
  • Desconectado Desconectado
  • Sexo: Masculino
  • Mensajes: 487
  • Un buen soporte lo es todo
    • Ver Perfil
    • Shakaran
Re:web2py?
« Respuesta #1 en: Abril 23, 2010, 13:23:23 pm »

Hola genes,

En ese tutorial indica los pasos en Apache como si fueras root, pero realmente no es necesario serlo para hacer las modificaciones que se piden.

Simplemente necesitas crear un archivo .htaccess con el contenido referido a tu usuario de Quijost. Por ejemplo asumiendo que tu usuario es genes, el archivo .htaccess podría ser:

Código: [Seleccionar]
WSGIDaemonProcess web2py user=genes group=genes \
                           display-name=GROUP}
WSGIProcessGroup web2py
WSGIScriptAlias / /home/genes/web2py/wsgihandler.py

<Directory /home/genes/web2py>
    AllowOverride None
    Order Allow,Deny
    Deny from all
    <Files wsgihandler.py>
      Allow from all
    </Files>
  </Directory>

  AliasMatch ^/([^/]+)/static/(.*) \
           /home/genes/web2py/applications/$1/static/$2
  <Directory /home/genes/web2py/applications/*/static/>
    Order Allow,Deny
    Allow from all
  </Directory>

  <Location /admin>
  Deny from all
  </Location>

  <LocationMatch ^/([^/]+)/appadmin>
  Deny from all
  </LocationMatch>
En línea
Ángel Guzmán Maeso
Quijost Founder - Backend Engineer & Main support

genes

  • Usuario nuevo
  • *
  • Karma: +0/-0
  • Desconectado Desconectado
  • Mensajes: 4
    • Ver Perfil
Re:web2py?
« Respuesta #2 en: Abril 23, 2010, 19:13:59 pm »

Muchas gracias por la ayuda. Hice esto y tengo un error 500, mirando el log veo:

[Fri Apr 23 19:03:48 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module not included in the server configuration

¿Será que falta instalar algo en el server?

Otra cosa que noté (y saqué) es que habia una llave (}) de mas (que tiene final pero no apertura).
En línea

genes

  • Usuario nuevo
  • *
  • Karma: +0/-0
  • Desconectado Desconectado
  • Mensajes: 4
    • Ver Perfil
Re:web2py?
« Respuesta #3 en: Abril 23, 2010, 19:23:03 pm »

Ahora estuve haciendo mas pruebas y parece no tener modwsgi, porque estos son los errores que obtengo:

Código: [Seleccionar]
[Fri Apr 23 19:19:08 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIScriptAlias&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:19:08 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIScriptAlias&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:19:08 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIScriptAlias&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:19:08 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIScriptAlias&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:18:14 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIProcessGroup&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:18:14 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIProcessGroup&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:18:14 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIProcessGroup&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:18:14 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIProcessGroup&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:07:15 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIDaemonProcess&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:07:15 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIDaemonProcess&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:07:14 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIDaemonProcess&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:07:14 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIDaemonProcess&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:03:49 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIDaemonProcess&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:03:49 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIDaemonProcess&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:03:48 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIDaemonProcess&#39;, perhaps misspelled or defined by a module not included in the server configuration
[Fri Apr 23 19:03:48 2010] [alert] [client 201.213.107.72] /home/genes/public_html/.htaccess: Invalid command &#39;WSGIDaemonProcess&#39;, perhaps misspelled or defined by a module not included in the server configuration
En línea

shakaran

  • Soporte
  • Administrator
  • Usuario profesional
  • *****
  • Karma: +12/-0
  • Desconectado Desconectado
  • Sexo: Masculino
  • Mensajes: 487
  • Un buen soporte lo es todo
    • Ver Perfil
    • Shakaran
Re:web2py?
« Respuesta #4 en: Abril 24, 2010, 00:48:04 am »

He estado probando y no podemos ejecutarlo porque Cpanel usa internamente python-2.4 y no podemos actualizar sin poner en conflicto todo el server para utilizar web2py que usa python 2.6

http://quijost.com/sandbox/index.py

Aqui puedes ver las versiones de python y django que se utilizan. Hasta que Cpanel no actualice no podemos soportar web2py, lo sentimos.
En línea
Ángel Guzmán Maeso
Quijost Founder - Backend Engineer & Main support

shakaran

  • Soporte
  • Administrator
  • Usuario profesional
  • *****
  • Karma: +12/-0
  • Desconectado Desconectado
  • Sexo: Masculino
  • Mensajes: 487
  • Un buen soporte lo es todo
    • Ver Perfil
    • Shakaran
Re:web2py?
« Respuesta #5 en: Abril 24, 2010, 16:55:03 pm »

Hola de nuevo genes, no me habia quedado muy conforme con la respuesta que te di, de que por culpa de cpanel no pudieramos actualizar y que tu usaras web2py. Asi que tras investigar mucho y hacer algunos trucos para solventar las dependencias de cpanel, python 2.6.5 esta instalado.
Python version: 2.6.5 (r265:79063, Apr 18 2010, 21:48:55)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
Django version: (1, 2, 0, 'beta', 1)
MySqldb version: (1, 2, 3, 'gamma', 1)

He intentado hacer algunas pruebas de ver si funciona web2py, pero me da un error que en google no hay información para arreglarlo, asi que estoy atascado:
http://quijost.com/sandbox/web2py/

File "/home/quijost/public_html/sandbox/web2py/web2py_modpython.py", line 5, in handler
    req.subprocess_env['PATH_INFO'] = req.subprocess_env['SCRIPT_URI']

KeyError: 'SCRIPT_URI'

Si tienes alguna información de como arreglar el error, probablemente puedas hacer funcionar web2py.
En línea
Ángel Guzmán Maeso
Quijost Founder - Backend Engineer & Main support

genes

  • Usuario nuevo
  • *
  • Karma: +0/-0
  • Desconectado Desconectado
  • Mensajes: 4
    • Ver Perfil
Re:web2py?
« Respuesta #6 en: Abril 24, 2010, 22:01:55 pm »

Hola, ante todo muchas gracias por el esfuerzo que estas haciendo por arreglar el problema.
Como haz creado el archivo web2py_modpython.py asumo que lo quieres hacer andar bajo modpython. ¿No seria posible intentar bajo modwsgi? (que es la forma recomendada).

En línea

shakaran

  • Soporte
  • Administrator
  • Usuario profesional
  • *****
  • Karma: +12/-0
  • Desconectado Desconectado
  • Sexo: Masculino
  • Mensajes: 487
  • Un buen soporte lo es todo
    • Ver Perfil
    • Shakaran
Re:web2py?
« Respuesta #7 en: Abril 24, 2010, 22:47:12 pm »

Puede que funcione como comentas bajo modwsgi (no tengo mucha experiencia con mod_wgsi, así que tu dirás):

Estos son los archivos que he puesto:
.htaccess
Código: [Seleccionar]
RewriteEngine on
SetEnv PYTHON_EGG_CACHE /home/quijost
SetHandler python-program
PythonHandler web2py_modpython
PythonPath "sys.path + ['/usr/local/src/web2py'] + ['/usr/lib/python2.6/site-packages/']"
PythonDebug On

DirectoryIndex index.html


web2py_modpython.py
Código: [Seleccionar]
from mod_python import apache
import modpythonhandler

def handler(req):
    req.subprocess_env['PATH_INFO'] = req.subprocess_env['SCRIPT_URI']
    return modpythonhandler.handler(req)

default.py
Código: [Seleccionar]
def index():
    """ Main Index Page """
    age = 30
    name = "John Smith"
    return dict(name=name, age=age)

"""   
def index():
    page_info = DIV('Hello', ' ', 'World', _id='hellomsg', _class='info')
    return dict(page_info=page_info)
"""

index.html
Código: [Seleccionar]
{{extend 'layout.html'}} <!-- Contains your "master" layout //-->
 
<h2>Hello {{=name}}</h2>
 
<p>Your Age is {{=age}} years old, in about a year, you will be {{=(age + 1}} years old,
isn't that scary?</p>
 
{{if age < 21:}}
    <p>You are a kid!</p>
{{pass}}
 
{{extend 'layout.html'}} <!-- Contains your "master" layout //--> {{=page_info}}
En línea
Ángel Guzmán Maeso
Quijost Founder - Backend Engineer & Main support

miguel

  • Usuario nuevo
  • *
  • Karma: +0/-0
  • Desconectado Desconectado
  • Mensajes: 1
    • Ver Perfil
Re:web2py?
« Respuesta #8 en: Octubre 29, 2013, 22:07:13 pm »

Hola,

Aunque sea reabrir un tema antiguo, estaba intentado montar web2py mediante mod_wsgi pero no lo consigo no se si habéis visto alguna solución. En webfaction existe un script que no se si aplica a vuestro hosting https://wiki.webfaction.com/wiki/Web2py-LatestSource

Lo he intentado con directivas htaccess pero nada. Mi htaccess en el directorio del dominio:

SetHandler wsgi-script
Options +ExecCGI
SetEnv PYTHON_EGG_CACHE /home/miguel/.python-eggs/
PythonDebug On
RewriteEngine On
RewriteRule ^((static|auth|admin|default|mycontroller2).*)$ /home/miguel/www/web2py/handlers/wsgihandler.py/welcome/$1 [QSA,PT,L]
En línea

shakaran

  • Soporte
  • Administrator
  • Usuario profesional
  • *****
  • Karma: +12/-0
  • Desconectado Desconectado
  • Sexo: Masculino
  • Mensajes: 487
  • Un buen soporte lo es todo
    • Ver Perfil
    • Shakaran
Re:web2py?
« Respuesta #9 en: Octubre 30, 2013, 12:47:58 pm »

Hola Miguel,

Este tema es viejo, casi de hace 3 años. Actualmente usamos Python 2.7 de base. La receta de webfaction no es aplicable ya que es para python 2.4 y usando mod_python.

Actualmente usamos mod_wsgi 3.4 por lo que directivas como PythonDebug On no son aplicables ya que son solo para mod_python (obsoleto).

Puedes usar la directiva:

Código: [Seleccionar]
DirectoryIndex index.py
Para ejecutar un archivo .py como wsgihandler.py. Tampoco hay necesidad de tener una instalación del propio web2py, porque este ya se encuentra instalado por defecto como paquete en los servidores de Quijost.
En línea
Ángel Guzmán Maeso
Quijost Founder - Backend Engineer & Main support
 

Página generada en 0.082 segundos con 35 consultas.