On Wednesday, July 4, 2018 at 11:57:44 PM UTC-7, Velu Narasimman wrote:
>
> Hi,
>
> I have deployed static resources into /var/www/html/htdocs dir. And
> used apache aliasing as documented here (
> https://trac.edgewall.org/wiki/TracInstall#MappingStaticResources) to map
> the css, js, images. Mapping worked fine.
>
> But say, I have aliased like this,
>
> Alias /trac/chrome /var/www/html/htdocs
>
>
> when I access https://mysite.com/trac/chrome It lists all the files and
> subdirectories inside the /var/www/html/htdocs dir. I want to disable it
> for security reason.
>
> I tried to configure apache like this,
>
> <Directory "/var/www/html/htdocs">
> Options -Indexes
> </Directory>
>
> But that didn't work. It still lists all files to public. How can I
> disable this directory listing?
>
The Directory directive you have should be sufficient. Make sure to reload
your configuration after making the change.
Here is a minimal Apache config for using a Python virtualenv on Ubuntu
16.04:
<VirtualHost *:8081>
DocumentRoot /var/www/trac/public
WSGIDaemonProcess /var/www/trac python-home=/var/www/trac/pve
WSGIScriptAlias /trac-modwsgi /var/www/trac/public/cgi-bin/trac.wsgi
Alias /trac-modwsgi/chrome /var/www/trac/public/htdocs
<Directory /var/www/trac/public/cgi-bin>
WSGIApplicationGroup %{GLOBAL}
WSGIProcessGroup /var/www/trac
Require all granted
</Directory>
<Directory /var/www/trac/public/htdocs>
Options -Indexes
</Directory>
</VirtualHost>
The directory listing of /trac-modwsgi/chrome can be enabled/disabled by
commenting/uncommenting the last Directory directive.
I suppose there could be another directive in your config that's overriding
the "Options -Indexes". If you continue to have trouble you may want to
post your entire configuration.
Are you editing a Apache conf file or editing a .htaccess file on a shared
hosting environment?
- Ryan
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.