2017-11-12 6 views
0

私はDebian8とApache/2.4.10(Debian)の下でRedmineをインストールしました。デフォルトインスタレーションの原因、それはリンクやヒントをグーグルmamy後にApache ... が提供する唯一のアプリです、私はここで説明する方法で、Apacheの設定でそれを変更してみてください。redmine sub-url on apache2 debian

基本的な記法ファイル(/etc/apache2/sites-available/redmine.conf)は次のとおりです。

# The passenger module (from the libapache2-mod-passenger package) must be 
# enabled 
<VirtualHost *:80> 
    # ServerName my.domain.name 
    # this is the passenger config eee 
    RailsEnv production 
    SetEnv X_DEBIAN_SITEID "default" 
    # CHANGE PassengerAppGroupName FOR OTHER INSTANCES 
    PassengerAppGroupName redmine_default 
    PassengerDefaultUser www-data 
    Alias "/plugin_assets/" /var/cache/redmine/default/plugin_assets/ 
    DocumentRoot /usr/share/redmine/public 
    <Directory "/usr/share/redmine/public"> 
     Allow from all 
     Options -MultiViews 
     Require all granted 
    </Directory> 
</VirtualHost> 

ので、私はこれが上位少し設定が移動しよう - CONF-利用できるために、(phpMyAdminのような類似の)利用可能なサイト、および作成/etc/apache2/conf-available/redmine.confから:

Alias /redmine /usr/share/redmine/public/ 

PassengerDefaultUser www-data 
DocumentRoot /usr/share/redmine/public 

<Location /redmine> 
    RailsEnv production 
    SetEnv X_DEBIAN_SITEID "default" 
    # CHANGE PassengerAppGroupName FOR OTHER INSTANCES 
    PassengerAppGroupName redmine_default 

</Location> 
Alias "/redmine/plugin_assets/" /var/cache/redmine/default/plugin_assets/ 

<Directory "/usr/share/redmine/public/"> 
     Allow from all 
     Options -MultiViews 
     Require all granted 
</Directory> 

と私がコメントを追加しました:

RedmineApp::Application.routes.default_scope = "/redmine" 

提出する:(にヒントに従って:http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI/usr/share/redmine/config/environment.rb

...と :-(今Redmineのは、 'localhost /をRedmineの' で動作しますが、例えば。 phpMyAdminのdoesntの仕事と私はredmine.confからDocumentRoot /usr/share/redmine/public行削除すると悪いRedmineのリンク

のように振る舞う - Redmineの以外のすべての作品を...リンクlocalhost/redmineショー:

は、あなたが/記法にアクセスする権限がありません 禁止します/このサーバー上で。

およびApacheのerror.log:

[Sun Nov 12 14:14:52.162868 2017] [autoindex:error] [pid 12220] [client ::1:45382] AH01276: Cannot serve directory /usr/share/redmine/public/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml ... 

私の質問は:試合別名に依存DocumentRootを使用する方法はありますか?それとも...それを修正する別の方法です

EDIT:

redmine.confがに変更されます。ファイルenvironment.rbの終わりに、

[...] 
#DocumentRoot /usr/share/redmine/public 
[...] 
<Directory "/usr/share/redmine/public/"> 

     PassengerEnabled on 
     SetHandler none 
     PassengerAppRoot /usr/share/redmine 
     RailsBaseURI /redmine/redmine 

     Allow from all 
     Options -MultiViews 
     Require all granted 
</Directory> 

そして、私が追加しました:

Redmine::Utils::relative_url_root = "/redmine" 

今では(RedmineとphpMyAdminと他のPHP)完璧です!彼らのウェブサイトから

PassengerBaseURI /redmine 

、ちょうどRedmineのでsubappを置き換える:

答えて

0

:-)

すでに旅客を使用しているので、あなたのアプリがサブフォルダにある場合に合格するために適切な値です。 ..

<VirtualHost *:80> 
    ServerName www.phusion.nl 
    DocumentRoot /websites/phusion/public 
    <Directory /websites/phusion> 
     Allow from all 
     Options -MultiViews 
     # Uncomment this if you're on Apache >= 2.4: 
     #Require all granted 
    </Directory> 

    # These have been added: 
    Alias /subapp /websites/secondapp/public 
    <Location /subapp> 
     PassengerBaseURI /subapp 
     PassengerAppRoot /websites/secondapp 

    </Location> 
    <Directory /websites/secondapp/public> 
     Allow from all 
     Options -MultiViews 
     # Uncomment this if you're on Apache >= 2.4: 
     #Require all granted 
    </Directory> 
</VirtualHost> 

の完全な統合ガイドは、次のとおりです。

https://www.phusionpassenger.com/library/deploy/apache/deploy/ruby/