Redmine does not work properly in Apache

I am trying to get Redmine (Ruby on Rails app) to work. It works great when you start with ruby script/server webrick -e production, but I can't get it to work in Apache using Passenger.

Access to http://example.com/redmine returns the Redmine homepage, but clicking any link (or even adding the result /to the URL) in 404. An event occurs according to the Rails log RoutingError. For example, when you open the projects page:ActionController::RoutingError (No route matches "/projects.html" with {:method=>:get})

Redmine Directory /var/www/localhost/htapps/redmine. I followed the documentation at http://www.modrails.org/documentation/Users%20guide.html#_deploying_a_ruby_on_rails_application (section 3.2), so there is a symbolic link in /var/www/localhost/htdocs/redminepointing to ../htapps/redmine/public, and Apache Configuration contains DocumentRoot /var/www/localhost/htdocsand RailsBaseURI /redmine.

What causes the rise of these RoutingErrors?

+3
source share
4 answers

It looks like this problem was caused by the default .htaccess included in Redmine.

Redmine .htaccessrewrites each request ending in .html. Redmine routes expect .html-less requests.

Customization RewriteEngine- Offsolved the problem for me.

+2
source

http://ptspts.blogspot.com/2009/05/how-to-fix-railsbaseuri-sub-uri-with.html

( , ) config/environment/production.rb:

config.action_controller.relative_url_root = '/redmine'

0

Sub-URI RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] public/.htaccess . IfModule -ed .htaccess.

- .htaccess, ( AuthType Digest ..). .

0

Redmine , redmine . , .

This question is almost one year old and is indicated for the next minor issue. Several dozens of minor issues have been released, but not yet been established. FCGI mode does not support sub-URIs .

0
source

Source: https://habr.com/ru/post/1710482/


All Articles