我想为 chiliproject 实例使用子目录。使用 apache 乘客,我正在考虑使用重写 + 别名,但它给了我一个 404。添加一个 RailsBaseURI 我得到连接重置。
是我应该适应的 routes.rb 还是我看错了地方?它现在正在https://mydomain.com上运行,但我想在https://mydomain.com/tracker上使用它
我想为 chiliproject 实例使用子目录。使用 apache 乘客,我正在考虑使用重写 + 别名,但它给了我一个 404。添加一个 RailsBaseURI 我得到连接重置。
是我应该适应的 routes.rb 还是我看错了地方?它现在正在https://mydomain.com上运行,但我想在https://mydomain.com/tracker上使用它
You can use passenger directly without having to use an alias or redirection. However, Passenger requires some special configuration for that. Please see one of our guides for a complete installation example.
Generally you need to configure similar to this (cited from the linked guide):
At first, we assume you have installed ChiliProject to /srv/www/chiliproject
. This is not your DocumentRoot.
You need to hint Passenger a bit here so that it correctly finds your ChiliProject. So we create a symlink from the existing DocumentRoot directory to out ChiliProject installation.
ln -s /srv/www/chiliproject/public DOCUMENTROOT/chiliproject
Now add the following directives into your existing virtual host:
# TODO: Remember to replace DOCUMENTROOT with your actual path
<Directory DOCUMENTROOT>
Options +SymLinksIfOwnerMatch
</Directory>
RailsBaseURI /chiliproject
# TODO: Remember to replace DOCUMENTROOT with your actual path
<Directory DOCUMENTROOT/chiliproject>
Options -MultiViews
Order deny,allow
Allow from all
</Directory>