On Aug 14, 3:39 pm, John Yeukhon Wong <gokoproj...@gmail.com> wrote:
> Hi, Graham
>
> I looked at the error log and I fully understood the problem.
>
> I spent an hour trying different ways to understand the whole thing.
> Here is the result.
>
> f:/public/testproject/apache/django.wsgi
>
> //code begins here
> import os, sys
> sys.path.append("f:/public")
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> //code ends here
>
> if I add your hello world code in this file, and restarted the apache,
> I will have hello world.
> I created a hello.wsgi (and hello.py). For each, I had to manually set
> up an alias
> For example this works
> WSGIScriptAlias /hello "f:/public/testproject/apache/hello.wsgi"
>
> I noticed that if I have two of them co-exist simultaneously
> WSGIScriptAlias / "f:/public/testproject/apache/django.wsgi"
> WSGIScriptAlias /testproject "f:/public/testproject/apache/hello.wsgi"

Wrong order as someone else pointed out. Most deeply nested URL must
be first.

> I will get nothing but the same default blue page. I looked the error
> log, nothing showed up. The access log, however, is interesting, but I
> couldn't get any information from the web.
>
> // portion of the log
> 127.0.0.1 - - [14/Aug/2010:00:48:45 -0400] "GET / HTTP/1.1" 200 12
> 127.0.0.1 - - [14/Aug/2010:00:48:46 -0400] "GET / HTTP/1.1" 200 12
> 127.0.0.1 - - [14/Aug/2010:00:49:02 -0400] "GET / HTTP/1.1" 200 2061
> 127.0.0.1 - - [14/Aug/2010:01:27:17 -0400] "GET / HTTP/1.1" 200 2061
> 127.0.0.1 - - [14/Aug/2010:01:27:18 -0400] "GET / HTTP/1.1" 200 2061
> 127.0.0.1 - - [14/Aug/2010:01:27:19 -0400] "GET / HTTP/1.1" 200 2061
> 127.0.0.1 - - [14/Aug/2010:01:27:25 -0400] "GET /testproject/ HTTP/
> 1.1" 200 2061
> 127.0.0.1 - - [14/Aug/2010:01:27:26 -0400] "GET /testproject/ HTTP/
> 1.1" 200 2061
>
> The one with 200 12 happened long before 200 2061 did. The 200 12 was
> the access record of only having one alias (either one, and not both).
> The 200 2061 is when both exist, and I reqest to access them. There is
> no error, but this 2061 code probably suggest something. Do you know
> by any chance?

That is the Apache access log file, not the Apache error log file.
Those values after HTTP status code are number of bytes returned.

This is all moot now as your original 403 error has long gone now
since you have it worked.

The error in Apache error log corresponding to 403 might have been
something like:

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

or:

  (13)Permission denied: access to / denied

as quoted in mod_wsgi talk slides (at bottom of error page shown by
browser).

which of those you got would have been clue to what was wrong way back
at that point.

Right now I figure you probably just hadn't restarted Apache after
making some change to Apache configuration and was only later when
making other changes and you restarted it, that picked up change.

Anyway, move on, as obviously have Django default page working now.

Graham


> Anyway. These tests conclude that I have my mod_wsgi working
> correctly.
>
> I understand that there are a few disadvantage of working on a MS, for
> example: lack of daemon mode, and a bit more complicated to handle
> users and file permission than on a UNIX.
>
> I do plan to deploy the project on a UNIX server in the future, and I
> still do want to follow up with the previous discussion:
>
> So in general,
>
> 1. When I write a django project, for each project I need a different /
> apache/ and the content within? I know mod_wgics is a module we use to
> allow apache to run python.... but I am not clear how we actually use
> it.
>
> 2. If I am going to work on a UNIX, let say a linux distro, if I
> create a wsgi folder outside /home/ (now i am clear which one you are
> referring to...), where do you prefer? How do I link it again? I am
> not very clear from the video because I am raised in United States,
> and your Australian accent troubled me a little...I am sorry...
>
> Thank you.
>
> John

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to