1

I want to deploy my django app using apache + mod_wsgi again. I seem to be getting this error 500 message Initially, I was told that I need the latest version of MySQLdb. After I had installed, I got this error message.

Error loading MySQLdb module: /tmp/MySQL_python-1.2.3-py2.4-linux-i686.egg-tmp/_mysql.so: failed to map segment from shared object: Permission denied

I am not sure really what the problem is. I believe it might have something to do with this line written in my httpd.conf.

WSGIPythonEggs /tmp

But it is set that that so it can read write & execute.

2
  • Why are you storing libraries in /tmp? Commented Jun 7, 2011 at 12:02
  • Are you not allowed to create an eggs cache in If I cannot put that line in my httpd.conf file, I will have this error[Errno 13] Permission denied: '/root/.python-eggs``/tmp?. Before, I could resolve this by having WSGIPythonEggs /tmpin my httpd.conf file. Now there are some problems from failing to map segment from shared object Commented Jun 7, 2011 at 12:27

2 Answers 2

1

SELinux is most likely enabled. This exact issue is documented in mod_wsgi documentation.

http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Secure_Variants_Of_UNIX

Sign up to request clarification or add additional context in comments.

Comments

0

Try a different directory than /tmp - according to this question, it has the t permission set, which disallows users deleting files not their own.

And you still need the WSGIPythonEggs directive.

Update: According to Graham Dumpleton's comment, the directive only works in embedded mode, not daemon mode. He gives a link to his wiki on fixing Application Permission issues, which suggests setting the variable in the mod_wsgi script module, not httpd.conf.

6 Comments

I have created a new directory called 'tmp2', I have change permissions to 755 and in my httpd.conf change, I have called WSGIPythonEggs /tmp2. This has not worked (rror[Errno 13] Permission denied: '/root/.python-eggs``/tmp2)
@Shehzad009, try 777 for permissions.
@John C: No that failed Can't extract file(s) to egg cache error again.
@Shehzad009, so the directory has full permissions, and it still doesn't work? Weird. I'm not sure why not, but I can say that when I had the same error (using uWSGI/nginx), I created a directory my user /home/foo/eggs, where eggs had full permissions (no t), and the directories above had x permissions so they could be searched. After running uWSGI, there was a new directory in eggs, called MySql...egg-tmp, owned by uWSGI.
@Shehzad009, after adding my update - I noticed that was your question. So his answer didn't work? Is this a new problem, or complications with the original problem?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.