Hi, I am running web2py with apache and cgi using this approach on my .htaccess:

RewriteEngine on
RewriteBase /home/devikhxr/public_lab-wp2
RewriteRule ^(admin|myapp)(/.*)?$ /cgi-bin/cgihandler.py

and cgihandler.py:

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-

    import os
    import sys
    import wsgiref.handlers

    path = os.path.dirname(os.path.abspath(__file__))
    path = "/home/myuser/resources/web2py/"
    os.chdir(path)

    if not os.path.isdir('applications'):
        raise RuntimeError('Running from the wrong folder')

    sys.path = [path] + [p for p in sys.path if not p == path]

    import gluon.main

    wsgiref.handlers.CGIHandler().run(gluon.main.wsgibase)


And everything is working ok except the app components, that returns a 502 Bad Gateway error.

I know that there are many better ways to run web2py, but for this project cgi is the only one. So some help with this will be appreciated.

--
Nunca digas nunca, di mejor: gracias, permiso, disculpe.

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to