Running CentOS 7 on a Digital Ocean droplet. The latest version of mod_wsgi is installed. From the command line I can do:
python app.py and then connect to port 5000. Using psycopg2 I am able to talk to my postgresql db. This works perfectly from within Flask and from pure command line scripts like ./bulk_load_psgq r 5000 (autopopulates a pgsql db)
[Thu Mar 12 16:47:50.442356 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] File "/var/www/wsgi/gcoos_itag/app/iTAG.py", line 76, in home
[Thu Mar 12 16:47:50.442462 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] my_receivers = get_my_receivers()
[Thu Mar 12 16:47:50.442479 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] File "/var/www/wsgi/gcoos_itag/app/gcoos_utils.py", line 45, in get_my_receivers
[Thu Mar 12 16:47:50.442570 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] conn = psycopg2.connect("dbname=itag user=postgres password=xxxxxxxxxxx")
[Thu Mar 12 16:47:50.442588 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] File "/usr/lib64/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
[Thu Mar 12 16:47:50.442702 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] conn = _connect(dsn, connection_factory=connection_factory, async=async)
[Thu Mar 12 16:47:50.442730 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] OperationalError: could not connect to server: No such file or directory
[Thu Mar 12 16:47:50.442737 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] \tIs the server running locally and accepting
[Thu Mar 12 16:47:50.442741 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658] \tconnections on Unix domain socket "/tmp/.s.PGSQL.5432"?
[Thu Mar 12 16:47:50.442746 2015] [wsgi:error] [pid 4990] [remote
71.226.81.79:18658]
My tmp file is present and EVERYTHING else about postgresql works fine. I've tried changing the WSGIDaemonProcess user to postgres, and have diddled with the pg_hba.conf file to no avail. This EXACT setup is working perfectly on my Mac OS X box...
Why would I be able to see the postgres server in all cases except through mod_wsgi? All help appreciated -- this is driving me crazy.
Thanks,
Bob Currier