> everything works great with the test server.

This tells you that the problem is most likely not with your urls.py
or any of your Django code, so you've cracked that part.

> I again cycled Apache off and on.  My "Under Construction" message is
> gone but only the only thing returned to a mysite.com request is "404
> not found: The requested URL / is not found on this server."

Unfortunately it doesn't seem that processing got as far as Django, as
that's not what Django's 404 page should say.

Looking at your conf samples it seems you've got the VirtualHost and
Location tags a little mixed up. And I'm guessing this is the only web
site you're running via this instance of apache.

> #LoadModule mod_placeholder /usr/lib/apache2/modules/
> mod_placeholder.so
> <Location "/mysite.com/">
>     SetHandler python-program
>     PythonHandler django.core.handlers.modpython
>     SetEnv DJANGO_SETTINGS_MODULE mysite.settings
>     PythonOption django.root /mysite.com
>     PythonDebug On
>     PythonPath "['/var/www/mysitehome'] + sys.path"
> </Location>

The URL after the <location bit should in fact refer to a path after
the domain name for which you want the enclosed behaviour to apply to.

So if I made a <Location "/blog/">, and I did this within a virtual
host directive for mysite.com, then the stuff within the location tag
would apply to all URLs starting <http://mysite.com/blog/> that Apache
was handling.

So if you want your Django application to handle all requests to a web
site, it should read <location "/"> - the context of the location tag
tells Apache which web site and domain names this applies to.

<http://httpd.apache.org/docs/1.3/mod/core.html#location>


> #  mystite.com (/etc/apache2/sites-available/www.mysite.com)

This file may not be being seen by Apache. You must ensure that
somewhere in the main configuration file for Apache, it knows to look
at this file using an Include directive.

<http://httpd.apache.org/docs/1.3/mod/core.html#include>

So, in this case:
Include sites-available/*
This will parse all files available in that folder for apache
configuration information.

If that doesn't work, there's nothing wrong with you adding your
virtual host definitions to the end of the httpd.conf file.

> <VirtualHost *>
>         ServerAdmin webmas...@mysite.com
>         ServerAlias mysite.com
>         ServerAlias *.mysite.com
>
>         # Indexes + Directory Root.
>         DirectoryIndex index.html
>         DocumentRoot /var/www/mysitehome/htdocs/
>
>         # CGI Directory
>         ScriptAlias /cgi-bin/ /var/www/mysitehome/cgi-bin/
>         <Location /cgi-bin>
>                 Options +ExecCGI
>         </Location>
>
>         # Logfiles
>         ErrorLog  /var/www/mysitehome/logs/error.log
>         CustomLog /var/www/mysitehome/logs/access.log combined
> </VirtualHost>
>

What you have to appreciate here is that by including the <location>
directive at the root level of the main configuration file [i.e. not
within this <virtualhost> directive], it only applies to the fallback
web site that Apache runs [the one that would be shown were there no
virtual hosts, and gets shown when Apache gets a request that doesn't
match any defined virtual hosts].

Instead, you need to move your previous <location> directive inside
the <virtualhost> directive here.

Hopefully that will work, and if not, take a look at the logs for
Apache [which tell you about errors when it starts up] - something
like /var/log/httpd/error_log

And leave in the ErrorLog directive for your virtualhost so that you
can see any ModPython errors in case they don't show up when you visit
the web site.

Ferg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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