Ferg, Thanks for such a thoughtful reply!
Your point about placing my <location> directive inside a <virtualhost> directive was well taken. In fact, I did finally find a thread within the group that also spoke well to my problem: http://groups.google.com/group/django-users/browse_thread/thread/8dab49bd8565a53a/57bd810ea9476ed6?lnk=gst&q=%22sites-enabled%22# Your advice and that found in the linked thread enabled me to bang Apache into shape. Here is the <virtualhost> directive that made things work for me: # # mysite.com (/etc/apache2/sites-available/www.mysite.com) # <VirtualHost *> ServerAdmin webmas...@mysite.com ServerAlias mysite.com ServerAlias *.mysite.com DocumentRoot /var/www/mysite <Directory /var/www/mysite> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug On </Directory> <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonDebug On PythonPath "['/var/www/'] + sys.path" </Location> # Logfiles ErrorLog /var/www/mysitehome/logs/error.log CustomLog /var/www/mysitehome/logs/access.log combined </VirtualHost> I left this directive in the file noted in the commentary header, and thus my httpd.conf file is blank. Now on to my production media settings! Cheers! Tim On Mar 14, 8:10 pm, Fergus <fergus.ferr...@gmail.com> wrote: > > 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 -~----------~----~----~----~------~----~------~--~---