0

I have a server configured with redmine using apache2 and redmine. The configuration was relative easy:

<VirtualHost localhost>
RailsEnv production
# create a link in /var/lib/redmine/default/passenger to /usr/share/redmine
PassengerAppRoot /var/lib/redmine/default/passenger
SetEnv X_DEBIAN_SITEID "default"
Alias "/plugin_assets/" /var/cache/redmine/default/plugin_assets/
DocumentRoot /usr/share/redmine/public
<Directory "/usr/share/redmine/public">
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

Now I wanted to have a subdirectory /downloads with static files. So I modified the configuration slightly

<VirtualHost localhost>
RailsEnv production
# create a link in /var/lib/redmine/default/passenger to /usr/share/redmine
PassengerAppRoot /var/lib/redmine/default/passenger
SetEnv X_DEBIAN_SITEID "default"
Alias "/plugin_assets/" /var/cache/redmine/default/plugin_assets/
DocumentRoot /usr/share/redmine/public
<Directory "/usr/share/redmine/public">
    Order allow,deny
    Allow from all
</Directory>

Alias "/downloads/" /srv/downloads/
<Directory "/srv/downloads/">
    Order allow,deny
    Allow from all
    Options +Indexes
</Directory>
</VirtualHost>

This worked fine without passenger installed, but not when passenger is used. Interestingly the request of

localhost/downloads/test.gif
works fine, but not the request for
localhost/downloads/
(which should show the directory listing... but instead queries redmine)

Is it possible somehow to still get a browsable mod_autoindex subdirectory?

1 Answer 1

1

It is necessary to also add a Location which disables the passenger.

<VirtualHost localhost>
RailsEnv production
# create a link in /var/lib/redmine/default/passenger to /usr/share/redmine
PassengerAppRoot /var/lib/redmine/default/passenger
SetEnv X_DEBIAN_SITEID "default"
Alias "/plugin_assets/" /var/cache/redmine/default/plugin_assets/
DocumentRoot /usr/share/redmine/public
<Directory "/usr/share/redmine/public">
    Order allow,deny
    Allow from all
</Directory>

Alias "/downloads/" /srv/downloads/
<Directory "/srv/downloads/">
    Order allow,deny
    Allow from all
    Options +Indexes
</Directory>
<Location /downloads/> 
  PassengerEnabled off 
</Location> 
</VirtualHost>

or an even better solution: Disable it by default and enable it only for the webapp

<VirtualHost localhost>
PassengerEnabled off 
RailsEnv production
# create a link in /var/lib/redmine/default/passenger to /usr/share/redmine
PassengerAppRoot /var/lib/redmine/default/passenger
SetEnv X_DEBIAN_SITEID "default"
Alias "/plugin_assets/" /var/cache/redmine/default/plugin_assets/
DocumentRoot /usr/share/redmine/public
<Directory "/usr/share/redmine/public">
    PassengerEnabled on 
    Order allow,deny
    Allow from all
</Directory>

Alias "/downloads" /srv/downloads
<Directory "/srv/downloads">
    Order allow,deny
    Allow from all
    Options +Indexes
</Directory>
</VirtualHost>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .