You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mirko Stocker <m1...@hsr.ch> on 2009/02/18 10:25:51 UTC

[users@httpd] Directory Listing only in Subdirectory

Hi

I have problems getting the following setup to work:

On my server, "Location /" is owned by mod_python, because I'm running a Trac 
as the main site on this domain. Now I'd like to have a directory listing in 
a subdirectory "Location /releases", but I can't get it working. I was able 
to configure it so that files are accessible under this directory with the 
following configuration:

    <Location /releases/>
        SetHandler file
    </Location>

But that's not really what I'd like to have. Now, is there a special handler 
that creates those listings? Note that if I remove my "Location /" 
configuration, I get the listings on /, so that seems to be ok, now I just 
need to get it to work only in the subdirectory :) Oh, and I get a "Attempt 
to serve directory: /var/www/releases/" error in my logfile, but I don't 
really understand what it wants to tell me in my case.


The (I guess relevant) sections from my config:

<VirtualHost * >
    DocumentRoot /var/www/
    ServerName xxx

    <Location /svn>
.....
    </Location>

    <Location />
        SetHandler mod_python
.....
        Order allow,deny
        Allow from all
    </Location>

    <Location /releases/>
        SetHandler file
    </Location>

    <Location /template/>
        SetHandler file
    </Location>

    <Location ~ "/\w+/login">
        AuthType Basic
        AuthName "Trac"
        AuthUserFile /etc/apache2/htpasswd
        Require valid-user
    </Location>

</VirtualHost>

Any help or ideas I could try are very welcome :)

Thanks,

Mirko



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Directory Listing only in Subdirectory

Posted by Mirko Stocker <m1...@hsr.ch>.
Hi

On Wednesday 18 February 2009 10:38:52 Karel Kubat wrote:
> Take a look at the Options configuration for your location where you
> want Apache to generate the listing. My site uses
>         Options +Indexes

Unfortunately, this doesn't change anything, I still get the error in the 
logfile and the page shows a 404.

Regards,

Mirko

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Directory Listing only in Subdirectory

Posted by Karel Kubat <ka...@e-tunity.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Mirko,

On Feb 18, 2009, at 10:25 AM, Mirko Stocker wrote:

> I have problems getting the following setup to work:
>
> On my server, "Location /" is owned by mod_python, because I'm  
> running a Trac
> as the main site on this domain. Now I'd like to have a directory  
> listing in
> a subdirectory "Location /releases", but I can't get it working. I  
> was able
> to configure it so that files are accessible under this directory  
> with the
> following configuration:
>
>    <Location /releases/>
>        SetHandler file
>    </Location>
>
> But that's not really what I'd like to have. Now, is there a special  
> handler
> that creates those listings? Note that if I remove my "Location /"
> configuration, I get the listings on /, so that seems to be ok, now  
> I just
> need to get it to work only in the subdirectory :) Oh, and I get a  
> "Attempt
> to serve directory: /var/www/releases/" error in my logfile, but I  
> don't
> really understand what it wants to tell me in my case.
>
> The (I guess relevant) sections from my config:
>
> <VirtualHost * >
>    DocumentRoot /var/www/
>    ServerName xxx
>
>    <Location /svn>
> .....
>    </Location>
>
>    <Location />
>        SetHandler mod_python
> .....
>        Order allow,deny
>        Allow from all
>    </Location>
>
>    <Location /releases/>
>        SetHandler file
>    </Location>
>
>    <Location /template/>
>        SetHandler file
>    </Location>
>
>    <Location ~ "/\w+/login">
>        AuthType Basic
>        AuthName "Trac"
>        AuthUserFile /etc/apache2/htpasswd
>        Require valid-user
>    </Location>
>
> </VirtualHost>
>
> Any help or ideas I could try are very welcome :)

Take a look at the Options configuration for your location where you  
want Apache to generate the listing. My site uses
	Options +Indexes
If you have symlinks there (careful! Don't point a symlink outside  
your doctree!) then you can use
	Options +Indexes +FollowSymlinks
Other options may apply to your configuration. It would depend on what  
options are already active when Indexes  gets added. (This of course  
goes into the right <Location> container.)

Hope this helps,
- --
Best regards / met vriendelijke groet, Karel Kubat
Mob +31 6 2956 4861



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkmb1ywACgkQ23FrzRzybNX+sACg/LDzH8Zom0eM2X9jLTgojuj1
FYwAn2Dk5v09NYym921yPpgYQE7rKA0W
=vvbO
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Directory Listing only in Subdirectory

Posted by Mirko Stocker <m1...@hsr.ch>.
On Wednesday 18 February 2009 13:20:59 Eric Covener wrote:
> SetHandler None

Yes, that did the trick :) Thanks a lot. Just for my own curiosity, where 
could I have found this on my own? 

Thanks!

Mirko

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Directory Listing only in Subdirectory

Posted by Eric Covener <co...@gmail.com>.
On Wed, Feb 18, 2009 at 4:25 AM, Mirko Stocker <m1...@hsr.ch> wrote:
> Hi
>
> I have problems getting the following setup to work:
>
> On my server, "Location /" is owned by mod_python, because I'm running a Trac
> as the main site on this domain. Now I'd like to have a directory listing in
> a subdirectory "Location /releases", but I can't get it working. I was able
> to configure it so that files are accessible under this directory with the
> following configuration:
>
>    <Location /releases/>
>        SetHandler file
>    </Location>

SetHandler None, or use LocationMatch instead of <Location> for mod_python?

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org