Re: mod_wsgi config issues.

281 views
Skip to first unread message

Graham Dumpleton

unread,
Jun 18, 2010, 12:42:08 AM6/18/10
to Shivek Khurana, modwsgi
On 18 June 2010 14:29, Shivek Khurana <shi...@gmail.com> wrote:
> Dear Sir,
> I've configured mod_wsgi from source with
> python3.1. Python3-dev and apache2-dev
> packages are properly installed as well. I
> see wsgi.load in mods-enabled.
> But what to do next ?? I'm not using any
> framework as its a small app that I wish
> to write from a scratch.
> Please help.
> Thank you

For mod_wsgi setup help read:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp

For an understand of what WSGI in general is and how to program at
that level start at:

http://www.wsgi.org/wsgi/

Please use the mailing list for mod_wsgi in future if you have
specific issues about mod_wsgi.

The mailing list details are in the document linked about where to get
help. This email has been cc'd back to the mailing list. You will need
to join the group however to do followups.

Graham

Graham Dumpleton

unread,
Jun 20, 2010, 12:40:41 AM6/20/10
to Shivek Khurana, modwsgi
Is there something about 'use the mailing list in future' from prior
emails that you don't understand?

On 20 June 2010 14:29, Shivek Khurana <shi...@gmail.com> wrote:
> Sir, I've successfully configured wsgi with due respect to documentation
> and it works fine.
> I have a small problem I've been Googling around for 2 consecutive days.
> I've set the WSGIScriptAlias to a partition in my hard drive which
> shamelessly
> returns a 403 forbidden error.
> I've tried everything but nothing worked. Can you help ?

You need to look at the Apache error log. If you see an error message like:

client denied by server configuration: /home/grumpy/example-1/hello.wsgi

Then you are missing from your Apache configuration a section similar to:

<Directory /home/grumpy/example-1>

Order deny,allow
Allow from all

</Directory>

which says that Apache is allowed to serve up a WSGI script file from
the directory where you put it.

If you don't see that error message in Apache error logs, then you
need to subscribe to the mailing list and post there the actual error
messages you are seeing in the Apache error logs for your request. You
also need to clarify whether the 403 is from Apache, or from your
specific WSGI application, plus actually quote the exact Apache
configuration snippet you are using to set up your application under
mod_wsgi, as well as indicate what WSGI application framework you
might be using.

Graham

> On Fri, Jun 18, 2010 at 12:52 PM, Shivek Khurana <shi...@gmail.com> wrote:
>>
>> Thank you.

Graham Dumpleton

unread,
Jun 20, 2010, 12:43:52 AM6/20/10
to Shivek Khurana, modwsgi
On 20 June 2010 14:40, Graham Dumpleton <graham.d...@gmail.com> wrote:
> Is there something about 'use the mailing list in future' from prior
> emails that you don't understand?
>
> On 20 June 2010 14:29, Shivek Khurana <shi...@gmail.com> wrote:
>> Sir, I've successfully configured wsgi with due respect to documentation
>> and it works fine.
>> I have a small problem I've been Googling around for 2 consecutive days.
>> I've set the WSGIScriptAlias to a partition in my hard drive which
>> shamelessly
>> returns a 403 forbidden error.
>> I've tried everything but nothing worked. Can you help ?
>
> You need to look at the Apache error log. If you see an error message like:
>
>  client denied by server configuration: /home/grumpy/example-1/hello.wsgi
>
> Then you are missing from your Apache configuration a section similar to:
>
>  <Directory /home/grumpy/example-1>
>  Order deny,allow
>  Allow from all
>  </Directory>

Hmmm, missed another possibility. If the Apache error log has:

(13)Permission denied: access to / denied

and the browser possibly showing something like:

You don't have permission to access / on this server.

then the problem is that you have stuck the WSGI script file in a
directory which has a parent directory somewhere which isn't
searchable/readable by the Apache user. This will often occur when you
stick it in your home directory and your home directory has
permissions of drwxr-x--- instead of drwxr-xr-x.

Remember the mailing list.

Graham

Graham Dumpleton

unread,
Jun 20, 2010, 1:29:06 AM6/20/10
to Shivek Khurana, modwsgi
On 20 June 2010 15:06, Shivek Khurana <shi...@gmail.com> wrote:
> I checked the error logs and its that (13) permissions denied error. And
> python threading ignored
> error (which you said is harmless at a google group.)
>
> And can you please post some link to soilid documentation about permissions.
> I'm not good on them.
> And If I'm correct,
> drwxr-xr-x stands for directory.write.execute.read -execute.write - execute
> i.e apache user has rights to execute.

A directory cant be executed. The 'x' on a directory means that the
directory can be searched or in other words a entry of known name can
be looked up. A 'r' on a directory means that the list of things in
the list can be obtained.

Read UNIX system manual page for 'chmod', ie.:

man chmod

as well as online resources such as:

http://en.wikipedia.org/wiki/Filesystem_permissions

and lots of others found by using Google.

> Thanks a lot.
> Sorry for troubling you with my problems.

All I ask is that you use the mod_wsgi mailing list to ask questions.
When people persist in ignoring requests to use the mailing list, then
I simply will not help to the degree I have here and instead just
point you at the mod_wsgi documentation and leave you to your own
devices. You are just lucky it is Sunday here and not working plus
that I am finishing off my PyCon talk today and it covers exactly
these types of errors in it. If I was at work I likely wouldn't be as
helpful.

Graham

> On Sun, Jun 20, 2010 at 10:13 AM, Graham Dumpleton

Reply all
Reply to author
Forward
0 new messages