The code is from:

http://www.web2pyslices.com/slice/show/1383/make-web2py-sub-url-mountable-with-apachemod-wsgi

I want to access a web2py application with the URL:

http://server/controlies

using apache and mod-wsgi.


El viernes, 13 de junio de 2014 18:58:02 UTC+2, Massimo Di Pierro escribió:
>
> What are you trying to do? This is not web2py code.
>
> On Friday, 13 June 2014 05:59:53 UTC-5, Alfonso Pastor Sierra wrote:
>>
>>
>> Hello, editing /var/web2py/subwsgihandler.py and commenting two lines:
>>
>>  def start_response(self, status, headers, info=None):
>>         # rewrite redirect URLs, so external referencens have the 
>> SCRIPT_NAME prefix
>>         if not status.startswith('3'):
>>             return self._start_response(status, headers, info)
>>         # status: 3xx (redirect)
>>         _headers = []
>>         for key, value in headers:
>>            # if key == 'Set-Cookie':
>>                 # don't modify the cookie, it already has a modified 
>> location
>>                 #return self._start_response(status, headers, info)
>>             # relative URLs start with '/', absolute URLs start with 
>> 'http'
>>             if key == 'Location' and value.startswith('/'):
>>                 value = self.script_name + value
>>             _headers.append((key, value))
>>         return self._start_response(status, _headers, info)
>>
>> it runs without errors.
>>
>> Why?
>>
>> El domingo, 1 de junio de 2014 13:06:18 UTC+2, Alfonso Pastor Sierra 
>> escribió:
>>>
>>> Hello, 
>>>
>>> I have a web2py application with apache:
>>>
>>> cat /etc/apache2/conf.d/controlies-apache 
>>>
>>>         WSGIScriptAlias /controlies /var/web2py/subwsgihandler.py
>>>
>>>         WSGIDaemonProcess web2py user=www-data group=www-data \
>>>                           home=/var processes=5 \
>>>                           maximum-requests=10000 \
>>>                           threads=1
>>>
>>>         <Location "/controlies">
>>>             Order deny,allow
>>>             Allow from all
>>>             WSGIProcessGroup web2py
>>>         </Location>
>>>
>>> With Debian Squeeze when I run:
>>>
>>> # wget http://ldap/controlies
>>>
>>> The result is:
>>>  
>>>
>>> --2014-05-31 21:10:19--  http://ldap/controlies
>>> Resolviendo ldap... 172.23.231.3
>>> Connecting to ldap|172.23.231.3|:80... conectado.
>>> *Petición HTTP enviada, esperando respuesta... 303 SEE OTHER*
>>> *Localización: 
>>> /controlies/init/default/user/login?_next=/controlies/init/default/index 
>>> [siguiendo]*
>>> *--2014-05-31 21:10:19-- 
>>>  
>>> http://ldap/controlies/init/default/user/login?_next=/controlies/init/default/index
>>>  
>>> <http://ldap/controlies/init/default/user/login?_next=/controlies/init/default/index>*
>>> *Reusing existing connection to ldap:80.*
>>> *Petición HTTP enviada, esperando respuesta... 200 OK*
>>> Longitud: 12488 (12K) [text/html]
>>> Saving to: `controlies'
>>>
>>> 100%[=====================>] 12.488      --.-K/s   in 0s      
>>>
>>> 2014-05-31 21:10:19 (803 MB/s) - `controlies' saved [12488/12488]
>>>
>>>
>>> But, after upgrading the server to Debian Wheezy when I run:
>>>
>>>
>>> #wget http://ldap/controlies
>>>
>>>
>>> The result is:
>>>  
>>>
>>> --2014-05-31 21:12:03--  http://ldap/controlies
>>> Resolviendo ldap... 172.23.231.3
>>> Connecting to ldap|172.23.231.3|:80... conectado.
>>> *Petición HTTP enviada, esperando respuesta... 303 SEE OTHER*
>>> *Localización: /init/default/user/login?_next=/init/default/index 
>>> [siguiendo]*
>>> *--2014-05-31 21:12:03-- 
>>>  http://ldap/init/default/user/login?_next=/init/default/index 
>>> <http://ldap/init/default/user/login?_next=/init/default/index>*
>>> *Reusing existing connection to ldap:80.*
>>> *Petición HTTP enviada, esperando respuesta... 404 Not Found*
>>> *2014-05-31 21:12:03 ERROR 404: Not Found.*
>>>
>>>
>>> From the web browser the error is:
>>>
>>> Not Found
>>> The requested URL /init/default/user/login was not found on this server.
>>>
>>>
>>> The apache error log is:
>>>
>>> [Thu May 29 13:14:56 2014] [error] [client 172.23.231.9] File does not 
>>> exist: /var/www/init, referer: http://ldap/ 
>>>
>>>
>>> Which may be the reason for the incorrect mapping and subsequent error?
>>>
>>> Thanks
>>>
>>>
>>>

-- 
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