Very strange. This seems more like an apache issue than a web2py. web2py 
simply does (in main.py):

    request.is_local = request.env.remote_addr in local_hosts

where remote address is in the http request as passed by the web server.

Could it be you have a visitor sharing the same virtual machine?

On Saturday, 2 June 2012 13:42:36 UTC-5, Jonathan Lundell wrote:
>
> I'm deploying web2py on a Rackspace VPS running Ubuntu 11.something, 
> Apache, mod_wsgi, MySQL. 
>
> It's been working fine, but recently, for debugging locally, I switched to 
> SQLite when is_local, so I could easily blow away my test data, etc. And 
> *that* worked fine. 
>
> But now I've deployed that version of the app to Rackspace, and I'm seeing 
> at least some of my remote requests showing up with is_local True. Below is 
> a dump of request.env for one such request. Notice that it looks completely 
> like a local request, but the server_software is Apache, and the request is 
> coming from my (remote) browser. 
>
> Any idea what's going on? I can hack the is_local test, but ... 
>
>
>
> request.env: <Storage { 
> 'debugging': False, 
> 'http_user_agent': 'monit/5.2.5', 
> 'script_filename': 
> '/home/wupadmin/.virtualenvs/watchup/watchup/web2py/wsgihandler.py', 
> 'script_name': '', 
> 'mod_wsgi_listener_host': '', 
> 'server_protocol': 'HTTP/1.1', 
> 'wsgi_errors': <mod_wsgi.Log object at 0x7f287e3f8370>, 
> 'web2py_path': '/home/wupadmin/.virtualenvs/watchup/watchup/web2py', 
> 'http_accept': '*/*', 
> 'wsgi_url_scheme': 'http', 'mod_wsgi_version': (3, 3), 
> 'server_name': 'localhost', 
> 'remote_addr': '127.0.0.1', 
> 'is_jython': False, 
> 'applications_parent': 
> '/home/wupadmin/.virtualenvs/watchup/watchup/web2py', 
> 'server_admin': '[no address given]', 
> 'mod_wsgi_request_handler': 'wsgi-script', 
> 'wsgi_version': (1, 1), 
> 'request_method': 'GET', 
> 'web2py_original_uri': '/', 
> 'server_port': '80', 
> 'mod_wsgi_script_reloading': '1', 
> 'wsgi_input': <mod_wsgi.Input object at 0x7f287e3f8570>, 
> 'server_addr': '127.0.0.1', 
> 'path_translated': '/home/wupadmin/.virtualenvs/watchup/watchup/web2py/
> wsgihandler.py/', 
> 'wsgi_multithread': True, 
> 'mod_wsgi_listener_port': '80', 
> 'gluon_parent': '/home/wupadmin/.virtualenvs/watchup/watchup/web2py', 
> 'server_software': 'Apache', 
> 'web2py_version': (2, 0, 0, datetime.datetime(2012, 5, 12, 3, 53, 36), 
> 'dev'), 
> 'http_host': 'localhost', 
> 'path_info': '/', 
> 'mod_wsgi_callable_object': 'application', 
> 'mod_wsgi_application_group': '198.101.194.206|', 
> 'request_uri': '/watchup/default/index', 
> 'http_connection': 'close', 
> 'wsgi_file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter 
> object at 0x7f287e3d44e0>, 
> 'wsgi_multiprocess': False, 
> 'is_pypy': False, 
> 'mod_wsgi_input_chunked': '0', 
> 'gateway_interface': 'CGI/1.1', 
> 'app_folders': 
> set(['/home/wupadmin/.virtualenvs/watchup/watchup/web2py/applications/admin/',
>  
> '/home/wupadmin/.virtualenvs/watchup/watchup/web2py/applications/watchup/']), 
>
> 'db_sessions': set([]), 
> 'server_signature': '', 
> 'mod_wsgi_handler_script': '', 
> 'remote_port': '34602', 
> 'query_string': '', 'wsgi_run_once': False, 
> 'document_root': '/etc/apache2/htdocs', 
> 'mod_wsgi_process_group': 'web2py'}> 
>
>

Reply via email to