apache2 debian 上的 redmine sub-url
redmine sub-url on apache2 debian
我在 Debian8 和 Apache/2.4.10 (Debian) 下安装了 Redmine,效果很好。默认安装导致,它只是由 Apache 服务的应用程序......
在妈妈谷歌搜索 links 和提示后,我尝试按照此处描述的方式使用 Apache 配置更改它:
基本 Redmine 文件 (/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>
所以,我尝试将此设置稍微向上移动 - 从 sites-available 到 conf-available(类似于 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"
归档:/usr/share/redmine/config/environment.rb
(根据提示:http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI
)
...和:-(
现在 Redmine 可以与 'localhost/redmine' 一起使用
但是,例如。 phpMyAdmin 不工作并且表现得像糟糕的 redmine-link
当我从 redmine.conf
中删除 DocumentRoot /usr/share/redmine/public
行时 - 除了 redmine 之外的所有工作... link localhost/redmine
显示:
禁止
您没有权限访问此服务器上的/redmine/。
和阿帕奇 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
?或者也许是另一种修复它的方法...
编辑:
当 redmine.conf
更改为:
[...]
#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>
并且,在文件 environment.rb
的末尾,我添加了:
Redmine::Utils::relative_url_root = "/redmine"
现在可以使用了(Redmine 和 phpMyAdmin 以及其他 php)完美!
:-)
由于您已经在使用 Passenger,如果您的应用位于子文件夹中,则传递的正确值是:
PassengerBaseURI /redmine
从他们的网站上,只需将 subapp 替换为 redmine...
<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/
我在 Debian8 和 Apache/2.4.10 (Debian) 下安装了 Redmine,效果很好。默认安装导致,它只是由 Apache 服务的应用程序...... 在妈妈谷歌搜索 links 和提示后,我尝试按照此处描述的方式使用 Apache 配置更改它:
基本 Redmine 文件 (/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>
所以,我尝试将此设置稍微向上移动 - 从 sites-available 到 conf-available(类似于 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"
归档:/usr/share/redmine/config/environment.rb
(根据提示:http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI
)
...和:-( 现在 Redmine 可以与 'localhost/redmine' 一起使用 但是,例如。 phpMyAdmin 不工作并且表现得像糟糕的 redmine-link
当我从 redmine.conf
中删除 DocumentRoot /usr/share/redmine/public
行时 - 除了 redmine 之外的所有工作... link localhost/redmine
显示:
禁止 您没有权限访问此服务器上的/redmine/。
和阿帕奇 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
?或者也许是另一种修复它的方法...
编辑:
当 redmine.conf
更改为:
[...]
#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>
并且,在文件 environment.rb
的末尾,我添加了:
Redmine::Utils::relative_url_root = "/redmine"
现在可以使用了(Redmine 和 phpMyAdmin 以及其他 php)完美!
:-)
由于您已经在使用 Passenger,如果您的应用位于子文件夹中,则传递的正确值是:
PassengerBaseURI /redmine
从他们的网站上,只需将 subapp 替换为 redmine...
<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/