Re: [modwsgi] mod_wsgi + apache getting 403

152 views
Skip to first unread message

Graham Dumpleton

unread,
Nov 5, 2012, 4:30:43 AM11/5/12
to mod...@googlegroups.com
In some places you have 'User' and other places 'Users'. You are
inconsistent. It should be 'Users' everywhere as that is what path
prefix is for user accounts on a Mac.

Graham

On 5 November 2012 20:23, Jonas Geiregat <jonas.sub...@gmail.com> wrote:
> I'm trying to setup mod_wsgi for apache under Mac OS X mountain lion.
>
> When I hit localhost/foobar I'm getting a 403 and the following log line:
>
> [Mon Nov 05 10:13:03 2012] [error] [client ::1] client denied by server
> configuration: /Users/jonas/dev/project/apache/project.wsgi
>
> apache_django_wsgi.conf:
>
> # mod_wsgi configuration directives - I like having stdout access, the other
> two
> # options run mod_wsgi in daemon mode - more on this in a minute.
> WSGIPythonHome /Users/jonas/Envs/project/
> WSGIRestrictStdout Off
> WSGIDaemonProcess django
> WSGIProcessGroup django
>
>
> #
> # This should be the path of the /mysite/media directory
> # for example "/Users/jesse/mysite/media/"
> #
> Alias /site_media/ "/Users/jonas/dev/project/media"
> <Directory "/Users/jonas/dev/project/media">
> Order allow,deny
> Options Indexes
> Allow from all
> IndexOptions FancyIndexing
> </Directory>
>
> #
> # Directory path to the admin media, for example:
> #
>
> Alias /media/
> "/User/jonas/Envs/project/lib/python-2.7/site-packages/django/contrib/admin/media/"
> <Directory
> "/User/jonas/Envs/project/lib/python-2.7/site-packages/django/contrib/admin/media">
> AllowOverride None
> Order allow,deny
> Allow from all
> Options Indexes
> IndexOptions FancyIndexing
> </Directory>
>
> #
> # Path to the mysite.wsgi file, for example:
> # "/Users/jesse/mysite/apache/mysite.wsgi"
> #
>
> WSGIScriptAlias /foobar "/Users/jonas/dev/project/apache/project.wsgi"
> <Directory "/User/jonas/dev/project/apache">
> Allow from all
> </Directory>
>
> <Directory "/User/jonas/dev/project">
> Allow from all
> </Directory>
>
> Here's the full error_log from apache:
>
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6519): Destroying
> interpreters.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6521): Destroying
> interpreters.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6519): Cleanup interpreter
> ''.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6521): Cleanup interpreter
> ''.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6520): Destroying
> interpreters.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6520): Cleanup interpreter
> ''.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6460): Shutdown requested
> 'django'.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6460): Stopping process
> 'django'.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6460): Destroying
> interpreters.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6460): Cleanup interpreter
> ''.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6461): Destroying
> interpreters.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6461): Cleanup interpreter
> ''.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6519): Terminating Python.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6521): Terminating Python.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6461): Terminating Python.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6460): Terminating Python.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6521): Python has shutdown.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6461): Python has shutdown.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6520): Terminating Python.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6460): Python has shutdown.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6520): Python has shutdown.
> [Mon Nov 05 10:13:49 2012] [info] mod_wsgi (pid=6519): Python has shutdown.
> [Mon Nov 05 10:13:49 2012] [info] removed PID file
> /private/var/run/httpd.pid (pid=6459)
> [Mon Nov 05 10:13:49 2012] [notice] caught SIGTERM, shutting down
> [Mon Nov 05 10:13:50 2012] [info] Init: Seeding PRNG with 144 bytes of
> entropy
> [Mon Nov 05 10:13:50 2012] [info] Init: Generating temporary RSA private
> keys (512/1024 bits)
> [Mon Nov 05 10:13:50 2012] [info] Init: Generating temporary DH parameters
> (512/1024 bits)
> [Mon Nov 05 10:13:50 2012] [warn] Init: Session Cache is not configured
> [hint: SSLSessionCache]
> [Mon Nov 05 10:13:50 2012] [info] Init: Initializing (virtual) servers for
> SSL
> [Mon Nov 05 10:13:50 2012] [info] mod_ssl/2.2.22 compiled against Server:
> Apache/2.2.22, Library: OpenSSL/0.9.8r
> httpd: Could not reliably determine the server's fully qualified domain
> name, using MacBook-Pro-van-Jonas.local for ServerName
> [Mon Nov 05 10:13:50 2012] [info] Init: Seeding PRNG with 144 bytes of
> entropy
> [Mon Nov 05 10:13:50 2012] [info] Init: Generating temporary RSA private
> keys (512/1024 bits)
> [Mon Nov 05 10:13:50 2012] [info] Init: Generating temporary DH parameters
> (512/1024 bits)
> [Mon Nov 05 10:13:50 2012] [info] Init: Initializing (virtual) servers for
> SSL
> [Mon Nov 05 10:13:50 2012] [info] mod_ssl/2.2.22 compiled against Server:
> Apache/2.2.22, Library: OpenSSL/0.9.8r
> [Mon Nov 05 10:13:50 2012] [debug] mod_wsgi.c(10486): mod_wsgi (pid=6530):
> Socket for 'django' is '/private/var/run/wsgi.6530.0.1.sock'.
> [Mon Nov 05 10:13:50 2012] [notice] Digest: generating secret for digest
> authentication ...
> [Mon Nov 05 10:13:50 2012] [notice] Digest: done
> [Mon Nov 05 10:13:50 2012] [info] mod_wsgi (pid=6531): Starting process
> 'django' with uid=70, gid=70 and threads=15.
> [Mon Nov 05 10:13:50 2012] [notice] Apache/2.2.22 (Unix) mod_ssl/2.2.22
> OpenSSL/0.9.8r DAV/2 mod_wsgi/3.4 Python/2.7.3 configured -- resuming normal
> operations
> [Mon Nov 05 10:13:50 2012] [info] Server built: Jun 20 2012 13:57:09
> [Mon Nov 05 10:13:50 2012] [debug] prefork.c(1023): AcceptMutex: flock
> (default: flock)
> [Mon Nov 05 10:13:50 2012] [info] mod_wsgi (pid=6531): Python home
> /Users/jonas/Envs/project/.
> [Mon Nov 05 10:13:50 2012] [info] mod_wsgi (pid=6531): Initializing Python.
> [Mon Nov 05 10:13:50 2012] [info] mod_wsgi (pid=6532): Python home
> /Users/jonas/Envs/project/.
> [Mon Nov 05 10:13:50 2012] [info] mod_wsgi (pid=6532): Initializing Python.
> [Mon Nov 05 10:13:50 2012] [info] mod_wsgi (pid=6531): Attach interpreter
> ''.
> [Mon Nov 05 10:13:50 2012] [info] mod_wsgi (pid=6532): Attach interpreter
> ''.
> [Mon Nov 05 10:13:50 2012] [debug] proxy_util.c(1818): proxy: grabbed
> scoreboard slot 0 in child 6532 for worker proxy:reverse
> [Mon Nov 05 10:13:50 2012] [debug] proxy_util.c(1934): proxy: initialized
> single connection worker 0 in child 6532 for (*)
>
> It seems like mod_wsgi is loading fine but there's a permission issue with
> apache accessing the folder or something.
>
> Any guidance or help is highly appreciated!
>
> --
> 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/-/EDFLM941kDAJ.
> To post to this group, send email to mod...@googlegroups.com.
> To unsubscribe from this group, send email to
> modwsgi+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.

Jonas Geiregat

unread,
Nov 5, 2012, 4:41:36 AM11/5/12
to mod...@googlegroups.com
On Mon, Nov 5, 2012 at 10:30 AM, Graham Dumpleton <graham.d...@gmail.com> wrote:
In some places you have 'User' and other places 'Users'. You are
inconsistent. It should be 'Users' everywhere as that is what path
prefix is for user accounts on a Mac.

Thanks for pointing that out so quickly, I've updated the config file and double checked everything.

But I'm still getting that some 403.  

Isn't there a way to get a more detailed debug information ? I've already set my apache LogLevel to info.

Graham Dumpleton

unread,
Nov 5, 2012, 4:50:14 AM11/5/12
to mod...@googlegroups.com
Show me your revised configuration, the exact URL you are using to
access the site and the exact error messages from the Apache error log
file.

These sorts of errors are described in the talk:

http://lanyrd.com/2010/pycon-au/szgqq/

if you care to watch that as well, but easier if you just send the
current configuration etc.

Graham
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
Reply all
Reply to author
Forward
0 new messages