6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Redmine2.3.0をサブディレクトリで動かす(Ruby2.0版)

Last updated at Posted at 2013-04-17

目的

今まではredmineをサブドメインで動かしていたのだけれど、redmine以外もSSLで繋がるようにしたかったので、サブディレクトリで動かす設定を調べた。

環境

  • Ruby 2.0.0
  • Redmine 2.3
    • Rails 3.2.13
  • Passenger 4.0 RC6

設定内容

Redmineは /usr/share/redmine-2.3.0 にある、という想定。

シンボリックリンクを張る

$ cd your-web-document-root
$ ln -s /usr/share/redmine-2.3.0 redmine

Apache 設定ファイル

<Location /redmine>
	PassengerAppRoot /usr/share/redmine-2.3.0
	RackBaseURI /redmine
</Location>

追記: 以前のパスからリダイレクトする

redmine.example.com -> example.com/redmine/ な設定。
ファイルが存在しなかった場合にのみリダイレクトする。 他のSSL接続するコンテンツにWordPressとかがあるとバグるかも。
Redmineのroutesに併せた正規表現でも書いてやれば確実か…?

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(/redmine) - [L]
    RewriteRule /(.*) https://example.com/redmine/$1 [R,L]
    <Location /redmine>
            PassengerAppRoot /usr/share/redmine-2.3.0
            RackBaseURI /redmine
    </Location>
6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?