Apache permissions problems deploying Pyramid

40 views
Skip to first unread message

Benjamin Sims

unread,
Oct 5, 2011, 9:00:57 AM10/5/11
to pylons-...@googlegroups.com
I've been experimenting with moving my Pyramid apps to Apache following the Chris's helpful tutorial at:


In order to isolate the problem, I've followed the whole thing exactly as is, substituting only correct user names for my server. However, when I try to access the app, I get (from the log):

(13)Permission denied: access to /myapp denied.

Has anyone any experience they can offer on this? There are various people reporting similar when I search for it, but none provide obvious solutions. 

The user and group are set to my username, and the application itself is entirely owned by my user also.

Thanks for any tips as to where I might go to move forward with this,

Ben

PS: Very minor typo in the tutorial I think: 

  Order allow, deny

should be:

  Order allow,deny

- Apache will throw an error if the space is omitted.

Wyatt Baldwin

unread,
Oct 5, 2011, 1:39:11 PM10/5/11
to pylons-...@googlegroups.com
Are the permissions along the path to your WSGI application module set correctly? For example, on the systems I deploy to, home directories are by default not accessible by 'other'.

Benjamin Sims

unread,
Oct 6, 2011, 6:03:09 AM10/6/11
to pylons-...@googlegroups.com
Thanks Wyatt.

Well, my apache config is set up as follows:

WSGIDaemonProcess pyramid user=benjamin group=benjamin processes=1 \
   threads=4 \
   python-path=/home/benjamin/modwsgi/env/lib/python2.6/site-packages
WSGIScriptAlias /myapp /home/benjamin/modwsgi/env/pyramid.wsgi

and the permissions are:

4 drwxrwxr-x 6 benjamin benjamin 4096 Oct  5 20:22 myapp
4 -rwxr-xr-x 1 benjamin benjamin  119 Oct  5 20:27 pyramid.wsgi

My understanding is that since this application is being run as me, then running from my own home folder should work. Am I wrong?

Ben

Wyatt Baldwin

unread,
Oct 6, 2011, 2:48:50 PM10/6/11
to pylons-...@googlegroups.com
This is what my typical mod_wsgi config looks like:

WSGIDaemonProcess myapp user=wyatt home=/home/wyatt/envs/mayapp display-name=myapp
WSGIScriptAlias /myapp /home/wyatt/envs/myapp/bin/app.wsgi
<Location /myapp>
    WSGIProcessGroup myapp
</Location>

Maybe you need to add a Location section?

Also, I'd double check the permissions on /home/benjamin (should be something like 701).

Benjamin Sims

unread,
Oct 6, 2011, 3:22:22 PM10/6/11
to pylons-...@googlegroups.com
Thanks so much Wyatt - it seems it was permissions related.

What I had not realised was that even though I had the user set as my own, Apache still needed permissions to access some of the files to run and I had to make sure the wsgi file was marked as executable correctly. That done, it seems fine now (well, at least it runs, I'm dealing with other problems at the moment).

Thanks again for pointing me in the right direction on this,
Ben


--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/Vi2OHd403dkJ.

To post to this group, send email to pylons-...@googlegroups.com.
To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.

Reply all
Reply to author
Forward
0 new messages