Okay, didn't see this before. This line is wrong: <Directory /usr/local/appnameenv/appnameenv>
should be: <Directory /usr/local/appnameenv/appname> Your weren't actually delegating it properly to daemon process group and so was still running as Apache user in embedded mode. Graham On 13 August 2012 12:21, Nate <[email protected]> wrote: > The wsgi embedded vs daemon mode test code returns: > > mod_wsgi.process_group = '' > > > I am not super familiar with logging with django. What is the best way to > log the info such as getuid and those various paths? > > > Nate > > > On Sun, Aug 12, 2012 at 7:19 PM, Graham Dumpleton > <[email protected]> wrote: >> >> Add checks from: >> >> >> http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Embedded_Or_Daemon_Mode >> >> into your WSGI script file to verify that the code in the daemon >> process is indeed the one it should be. >> >> Also log os.getuid() to verify what user ID process is running as. >> >> Try logging output of: >> >> os.listdir('/var') >> os.listdir('/var/www') >> os.listdir('/var/www/repo') >> os.listdir('/var/www/repo/catalogs') >> >> What is your code trying to do to that directory anyway? Do you know >> which line of code in your application causes the error? >> >> Graham >> >> On 13 August 2012 09:08, Nate <[email protected]> wrote: >> > Output of ls -las /var/www/repo: >> > >> > 4 drwxrwx--- 7 app root 4096 Aug 12 19:01 . >> > 4 drwxr-xr-x. 7 root root 4096 Aug 12 13:01 .. >> > 4 drwxrwx--- 2 app root 4096 Aug 12 13:12 catalogs >> > 4 drwxrwx--- 2 app root 4096 Apr 9 22:24 manifests >> > 4 drwxrwx--- 3 app root 4096 Apr 9 21:47 pkgs >> > 4 drwxrwx--- 3 app root 4096 Apr 9 21:51 pkgsinfo >> > 4 drwxrwx--- 2 app root 4096 Jun 8 18:17 Scripts >> > >> > >> > Confirmed selinus is off: >> > [root@CentOS ~]# sestatus >> > SELinux status: disabled >> > >> > Thanks! >> > >> > Nate >> > >> > On Sun, Aug 12, 2012 at 5:08 PM, Graham Dumpleton >> > <[email protected]> wrote: >> >> >> >> Does 'catalogs' already exist? >> >> >> >> What is output of running: >> >> >> >> ls -las /var/www/repo >> >> >> >> Do you have SELinux enabled? Try temporarily turning off enforcement >> >> and see if it is causing it. >> >> >> >> http://www.crypt.gen.nz/selinux/disable_selinux.html >> >> >> >> Graham >> >> >> >> On 13 August 2012 04:46, Nate <[email protected]> wrote: >> >> > I have a django app setup in /usr/local/appname and it is configured >> >> > using >> >> > mod_wsgi and the following virtual host: >> >> > >> >> > <VirtualHost *:80> WSGIScriptAlias / >> >> > /usr/local/appnameenv/appname/appname.wsgi WSGIDaemonProcess appname >> >> > user=app group=app Alias /static/ >> >> > /usr/local/appnameenv/appname/static/ >> >> > <Directory /usr/local/appnameenv/appnameenv> WSGIProcessGroup appname >> >> > WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all >> >> > </Directory> >> >> > </VirtualHost> >> >> > >> >> > And here is the wsgi file: >> >> > >> >> > import os, sys >> >> > import site >> >> > >> >> > APPNAME_ENV_DIR = '/usr/local/appnameenv' >> >> > >> >> > # Use site to load the site-packages directory of our virtualenv >> >> > site.addsitedir(os.path.join(APPNAME_ENV_DIR, >> >> > 'lib/python2.6/site-packages')) >> >> > >> >> > # Make sure we have the virtualenv and the Django app itself added to >> >> > our >> >> > path >> >> > sys.path.append(APPNAME_ENV_DIR) >> >> > sys.path.append(os.path.join(APPNAME_ENV_DIR, 'appname')) >> >> > >> >> > os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' >> >> > >> >> > import django.core.handlers.wsgi >> >> > application = django.core.handlers.wsgi.WSGIHandler() >> >> > >> >> > This app needs to read/write data to /var/www/repo >> >> > >> >> > Currently, the permissions on /var/www/repo looks like this: >> >> > >> >> > 4 drxwrxw--- 7 app >> >> > >> >> > If I su to the 'app' service account, I can create/delete files >> >> > inside >> >> > of >> >> > /var/www/repo just fine. When I use the built in django dev server, >> >> > it >> >> > can >> >> > read/write to the files in /var/www/repo as expected. >> >> > >> >> > When the app is running via mod_wsgi, I get the following exception: >> >> > >> >> > Exception Value: >> >> > [Errno 13] Permission denied: '/var/www/repo/catalogs' >> >> > >> >> > Suggestions? >> >> > >> >> > Thanks, >> >> > >> >> > Nate >> >> > >> >> > -- >> >> > You received this message because you are subscribed to the Google >> >> > Groups >> >> > "modwsgi" group. >> >> > To view this discussion on the web visit >> >> > https://groups.google.com/d/msg/modwsgi/-/bIPQ9LsiKlIJ. >> >> > To post to this group, send email to [email protected]. >> >> > To unsubscribe from this group, send email to >> >> > [email protected]. >> >> > For more options, visit this group at >> >> > http://groups.google.com/group/modwsgi?hl=en. >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups >> >> "modwsgi" group. >> >> To post to this group, send email to [email protected]. >> >> To unsubscribe from this group, send email to >> >> [email protected]. >> >> For more options, visit this group at >> >> http://groups.google.com/group/modwsgi?hl=en. >> >> >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "modwsgi" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group at >> > http://groups.google.com/group/modwsgi?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/modwsgi?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
