I have the following lines in /etc/apache2/sites-available/default:
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
Alias /debian/ /mnt/sda1/ibr/debian/
<Directory /mnt/sda1/ibr/debian>
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
<Location />
SetHandler python-program
...
When I try to access http://localhost/debian/ , I get Django's nice 404
error message. http://httpd.apache.org/docs/2.0/mod/core.html#location
says Location directives are processed after the Directory directives.
Can I have Django accessible at /, and other content still accessible
under other directories?
Thanks in advance,
Baurzhan.
Yes. You should Directories describing '/debian/' _after_ your
'<Location />' for this general rule not overwrite more specific ones.
Also you may have to convert your <Directories> to <Locations>
thanks for your fast response!
On Sat, Aug 26, 2006 at 01:19:20PM +0400, Ivan Sagalaev wrote:
> > Can I have Django accessible at /, and other content still accessible
> > under other directories?
>
> Yes. You should Directories describing '/debian/' _after_ your
> '<Location />' for this general rule not overwrite more specific ones.
> Also you may have to convert your <Directories> to <Locations>
Hmm, I've converted <Directory /mnt/sda1/ibr/debian> to <Location
/debian> and put it after <Location />:
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Location />
SetHandler python-program
...
</Location>
Alias /debian /mnt/sda1/ibr/debian
<Location /debian>
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Location>
<Location /debian> works if I comment out <Location />. If not, I get
the following response:
<pre>
Mod_python error: "PythonHandler django.core.handlers.modpython"
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 301, in HandlerDispatch
assert (type(result) == type(int())), \
AssertionError: Handler 'django.core.handlers.modpython' returned invalid return code.
</pre>
What is wrong here?
With kind regards,
Baurzhan.
Oh I've forgot. It happens because Apache still passes all requests to
mod_python because of SetHandler set in the first rule. In subsequent
locations you have to also reset it with SetHandler None.
On Sat, Aug 26, 2006 at 02:26:28PM +0400, Ivan Sagalaev wrote:
> Oh I've forgot. It happens because Apache still passes all requests to
> mod_python because of SetHandler set in the first rule. In subsequent
> locations you have to also reset it with SetHandler None.
It worked, thanks much!
With kind regards,
Baurzhan.