https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292019-03-22T16:24:01ZRedmineRedmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=908882019-03-22T16:24:01ZBernhard Loos
<ul></ul><p>Exception trace:<br />rake aborted!<br />The direct method can't be used inside a routes scope block<br />/usr/local/bundle/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:2099:in `direct'<br />/usr/local/bundle/gems/activestorage-5.2.2/config/routes.rb:6:in `block in <top (required)>'<br />/usr/local/bundle/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:641:in `instance_exec'<br />/usr/local/bundle/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:641:in `block in with_default_scope'<br />/usr/local/bundle/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:879:in `scope'<br />/usr/local/bundle/gems/actionpack-5.2.2/lib/action_dispatch/routing/mapper.rb:640:in `with_default_scope'<br />/usr/local/bundle/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:430:in `eval_block'<br />/usr/local/bundle/gems/actionpack-5.2.2/lib/action_dispatch/routing/route_set.rb:414:in `draw'<br />/usr/local/bundle/gems/activestorage-5.2.2/config/routes.rb:3:in `<top (required)>'<br />/usr/local/bundle/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'<br />/usr/local/bundle/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `block in load'<br />/usr/local/bundle/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'<br />/usr/local/bundle/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `block in load_paths'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `each'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `load_paths'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:20:in `reload!'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:30:in `block in updater'<br />/usr/local/bundle/gems/activesupport-5.2.2/lib/active_support/file_update_checker.rb:83:in `execute'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:10:in `execute'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application/finisher.rb:130:in `block in <module:Finisher>'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'<br />/usr/src/redmine/config/environment.rb:14:in `<top (required)>'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application.rb:337:in `require'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application.rb:337:in `require_environment!'<br />/usr/local/bundle/gems/railties-5.2.2/lib/rails/application.rb:520:in `block in run_tasks_blocks'<br />Tasks: TOP => db:migrate => db:load_config => environment</p> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=909382019-03-26T01:55:02ZPavel Rosický
<ul></ul><p>try this<br /><pre>
config.ru
require ::File.expand_path('../config/environment', __FILE__)
map ENV['RAILS_RELATIVE_URL_ROOT'] || '/' do
run Rails.application
end
</pre></p>
<p>and don't forget to set the variable in your environment, for example<br /><pre>
/etc/systemd/system/unicorn.service
[Service]
Environment=RAILS_RELATIVE_URL_ROOT=/redmine
...
</pre></p> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=910542019-04-01T12:36:09ZBernhard Loos
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li></ul><p>This seems to work, thank you.</p> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=910892019-04-03T17:59:11ZToshi MARUYAMA
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/91089/diff?detail_id=73267">diff</a>)</li></ul> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=910902019-04-03T18:05:06ZToshi MARUYAMA
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Thank you for your feedback.</p> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=911602019-04-08T11:39:37ZVincent Robert
<ul><li><strong>Affected version</strong> changed from <i>4.0.2</i> to <i>4.0.3</i></li></ul><p>I met exactly the same issue today, upgrading from 3.4 to 4.0.</p>
<p>Thank you Pavel for this solution. It works great!</p> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=926392019-06-27T16:37:06ZVVD VVD
<ul></ul><p>Doesn't work for me on fresh installation of 4.0.4 + apache 2.4.39 + passenger 6.0.2. Tried with mod_proxy and without.<br />Can you show your apache httpd-vhost.conf?<br />What changes you made in redmine files (config.ru, config/environment.rb, etc.)?</p>
<p>Thanks!</p> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=926402019-06-27T22:07:28ZVVD VVD
<ul></ul><p>It work now.</p>
<p>My configs:<br />$ cat /usr/local/etc/apache24/extra/httpd-vhosts.conf<br /><pre>
<VirtualHost *>
DocumentRoot "/opt/www"
ServerName hostname.domain.local
ServerAlias hostname
<Directory "/opt/www">
Options -Indexes -MultiViews
AllowOverride none
Require all granted
</Directory>
<IfModule mod_proxy.c>
ProxyTimeout 1800
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass /redmine http://hostname-redmine/redmine
ProxyPassReverse /redmine http://hostname-redmine/redmine
</IfModule>
</VirtualHost>
LoadModule passenger_module /usr/local/lib/ruby/gems/2.6/gems/passenger-6.0.2/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/2.6/gems/passenger-6.0.2
PassengerRuby /usr/local/bin/ruby
PassengerDefaultUser www
PassengerMaxPoolSize 16
PassengerMaxInstancesPerApp 0
<VirtualHost *>
DocumentRoot "/opt/redmine/public"
#Alias /redmine "/opt/redmine/public"
ServerName hostname-redmine.domain.local
ServerAlias hostname-redmine
RailsEnv production
<Directory "/opt/redmine/public">
Options -Indexes +ExecCGI +FollowSymLinks -MultiViews
AllowOverride none
Require all granted
SetEnv RAILS_RELATIVE_URL_ROOT "/redmine"
</Directory>
</VirtualHost>
</pre><br />$ cat /opt/redmine/config.ru<br /><pre>
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
map ENV['RAILS_RELATIVE_URL_ROOT'] || '/' do
run Rails.application
end
</pre></p>
Users open in browsers URLs:
<ul>
<li><a class="external" href="http://hostname.domain.local">http://hostname.domain.local</a> - some custom static content;</li>
<li><a class="external" href="http://hostname.domain.local/redmine">http://hostname.domain.local/redmine</a> - Redmine.</li>
</ul> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=943392019-10-14T11:44:21ZRobert Auer
<ul></ul><p>Hi!</p>
<p>I am trying to install Redmine 4.0.4 in a Docker container and I want to make it accessible under the '/redmine' sub-URI. I'm experiencing the same problem as described in post 1 and have tried all your solutions already but nothing is working.</p>
<p>Has someone got another solution or can explain what the problem is exactly?</p>
<p>Thanks!</p>
<p>PS: Description of my environment:<br />PostgreSQL 9.6.10<br />ruby 2.5.5p157 (2019-03-15 revision 67260)<br />Rails 5.2.3<br />Redmine 4.0.4 in alpine linux 3.9.4 Docker container</p> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=944892019-10-22T10:01:25ZRobert Auer
<ul></ul><p>Found a solution for my problem, see <a class="external" href="https://www.redmine.org/issues/32318#note-1">https://www.redmine.org/issues/32318#note-1</a></p> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=944912019-10-22T10:50:47ZMarius BĂLTEANU
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/32318">Defect #32318</a>: Redmine 4.0 can not be installed in a sub-URI any more</i> added</li></ul> Redmine - Defect #31085: Hosting redmine at a suburl doesn't work anymore in 4.0https://www.redmine.org/issues/31085?journal_id=1032002021-07-12T02:04:00Zkeineahnung 2345mimifasosofamire1123@gmail.com
<ul></ul><p>Thanks, <a class="user active" href="https://www.redmine.org/users/11234">pavel ochman</a> Rosický's solution works for me.<br />I am using Redmine 4.1.1.</p>
<p>The following is the methods that don't work for me: <a class="external" href="https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI">https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI</a>, <a class="external" href="https://www.phusionpassenger.com/library/deploy/apache/deploy/ruby/#deploying-an-app-to-a-sub-uri-or-subdirectory">https://www.phusionpassenger.com/library/deploy/apache/deploy/ruby/#deploying-an-app-to-a-sub-uri-or-subdirectory</a> and <a class="external" href="https://stackoverflow.com/questions/17753631/how-to-deploy-rails-app-on-subdomain-root-with-apache-and-passenger/17764475">https://stackoverflow.com/questions/17753631/how-to-deploy-rails-app-on-subdomain-root-with-apache-and-passenger/17764475</a>.</p>