Re: Mysql DB local socket access errors with mod_wsgi

2014-05-28 Thread Henning Sprang
On Wed, May 28, 2014 at 3:18 PM,   wrote:
> It's very likely a permissions problem. Webserver processes tend to run under 
> a special username (e.g. www-data) with very limited permissions - it's 
> likely that this user does not have access to the socket file.

Yeah, that was the thing, thanks!

Actually I looked at the permissions, but the socket file had 777, but
the directory is 700 and owned by mysql:root.

If I experimentally chowned the directory to www-data and it works.
Which is strange as the mysql command line client connects via socket,
too when not given a hostname, I believe, and it works well when run
as a normal user.

Anyway, thanks for the pointer.

Henning

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB10%2BLtoSik%2BhzZ96e6-%2BrGB6mTiA_aCiRjoW%3Dd4No9qGskWhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql DB local socket access errors with mod_wsgi

2014-05-28 Thread jirka . vejrazka
It's very likely a permissions problem. Webserver processes tend to run under a 
special username (e.g. www-data) with very limited permissions - it's likely 
that this user does not have access to the socket file.

  HTH

   Jirka

-Original Message-
From: Henning Sprang 
Sender: django-users@googlegroups.com
Date: Wed, 28 May 2014 11:28:00 
To: 
Reply-To: django-users@googlegroups.com
Subject: Mysql DB local socket access errors with mod_wsgi

Hi,

I'm trying to setup a django production environment with mod_wsgi, and
a local mysql  which I want to connect via the socket file.

Without wsgi the app runs and connects to the database.

When running it via wsgi, I get:

OperationalError

(2002, "Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (13)")

It might be relevant that I'm running the app and the db in Docker
containers, sharing the directory with the socket file in between
them. On the other hand, as running the app manually with runserver
works well, I guess it must be something else.

I tried every imaginable configuration, from the simplest described in
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/
to just about anything described there, the socket file defintely
exists at this path, and I also tried to explicitly allow apache
access with a directory/files directive in apache - no success.

Any ideas?

-- 
Henning Sprang
http://www.sprang.de

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB10%2BLu%3DJwCgLv46FDpE3-4Tu6b%2B7C15rf1vcEBsmFXB%2B44NCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2097542386-1401286725-cardhu_decombobulator_blackberry.rim.net-540712219-%40b1.c3.bise7.blackberry.
For more options, visit https://groups.google.com/d/optout.


Mysql DB local socket access errors with mod_wsgi

2014-05-28 Thread Henning Sprang
Hi,

I'm trying to setup a django production environment with mod_wsgi, and
a local mysql  which I want to connect via the socket file.

Without wsgi the app runs and connects to the database.

When running it via wsgi, I get:

OperationalError

(2002, "Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (13)")

It might be relevant that I'm running the app and the db in Docker
containers, sharing the directory with the socket file in between
them. On the other hand, as running the app manually with runserver
works well, I guess it must be something else.

I tried every imaginable configuration, from the simplest described in
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/
to just about anything described there, the socket file defintely
exists at this path, and I also tried to explicitly allow apache
access with a directory/files directive in apache - no success.

Any ideas?

-- 
Henning Sprang
http://www.sprang.de

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB10%2BLu%3DJwCgLv46FDpE3-4Tu6b%2B7C15rf1vcEBsmFXB%2B44NCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.