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.


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.


Re: What happens when secret key is lost?

2014-05-21 Thread Henning Sprang
Hi Erik,

On Tue, May 20, 2014 at 8:34 PM, Erik Romijn  wrote:
> ...
> If it were used for that, that would indeed be the scenario. Fortunately, 
> it's not.

Good to know :)

> There is a current ticket open on documenting exactly this question: 
> https://code.djangoproject.com/ticket/22310. I'd worked through most of it 
> but somehow lost my changes.

Thanks for your explanations - they help a lot!
As of the location where to document it, I stumbled about it in the
"deployment checklist" part of the docs, there was only said it's
important to keep it secret while those further questions kept
unanswered - so when adding more info, you might also put a link on
the deployment pages when working on it anyway.

Let me know if you need help, e.g. proof-reading through what you will
put in the docs.

Thanks&Cheers,
Henning



-- 
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%2BLshtW0XfykqR5nUQ_ir-OwkCtdR2TKfox2e3PSR1Hf_qQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


What happens when secret key is lost?

2014-05-20 Thread Henning Sprang
Hi,

I developed quite a bit in Django already, but only now I am the first
time responsible for putting something into real production use.

So I work through the deployment checklist, and it says the secret key
must be kept super secret. One example shows how to set it as
environment variable.

The question is, what happens when I lose it - when it's used for
password hash salt, doesn't that mean if it's lost, all users have to
reset their password, don't they?

Also, if it should be kept secret, I guess it's safe to assume that
using an online generator like
https://djskgen.herokuapp.com/ is not the smartest idea one can come
up with, right?

Cheers and thanks in advance,
Henning

-- 
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%2BLttXyVO8NRJ3S4jG82_c_cOK2po9EoQmRj1hbOA029q7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.