On Jun 2, 2012, at 12:42 PM, Massimo Di Pierro wrote:
> 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?
I don't think so; it's a dedicate VPS and web2py is the only app running.
I thought it might be some odd misconfiguration of static fetches (don't ask me
what), but they seem to be working fine.
Hmm. I'm looking at the Apache access logs, and I see this every 10 minutes.
Looks like there's some local process querying the server for monitoring
purposes, a surprise to me. I'll check with Rackspace to see what it is.
That suggests another workaround: I don't actually need the database for my
default controller, so I can make my table definitions dependent on the
controllers that need them. I'll report back if I find anything out.
localhost - - [02/Jun/2012:19:45:02 +0000] "GET /server-status?auto HTTP/1.1"
200 242
localhost - - [02/Jun/2012:19:45:03 +0000] "GET /server-status?auto HTTP/1.1"
200 242
localhost - - [02/Jun/2012:19:45:04 +0000] "GET /server-status?auto HTTP/1.1"
200 241
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET / HTTP/1.0" 200 6067
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET /robots.txt HTTP/1.0" 200 46
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET /watchup/static/favicon.ico
HTTP/1.0" 200 198
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET
/watchup/static/js/modernizr.custom.js HTTP/1.0" 200 13677
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET /watchup/static/js/jquery.js
HTTP/1.0" 200 93869
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET
/watchup/static/css/calendar.css HTTP/1.0" 200 2941
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET /watchup/static/js/calendar.js
HTTP/1.0" 200 45256
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET /watchup/static/js/web2py.js
HTTP/1.0" 200 6305
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET
/watchup/static/css/skeleton.css HTTP/1.0" 200 21946
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET /watchup/static/css/web2py.css
HTTP/1.0" 200 10139
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET
/watchup/static/css/superfish.css HTTP/1.0" 200 3627
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET /watchup/static/js/superfish.js
HTTP/1.0" 200 8465
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET
/watchup/static/images/poweredby.png HTTP/1.0" 200 4150
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET
/watchup/static/images/arrows-ffffff.png HTTP/1.0" 200 244
127.0.0.1 - - [02/Jun/2012:19:45:06 +0000] "GET
/watchup/static/images/shadow.png HTTP/1.0" 200 1698
>
> 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'}>
>