问题描述
现在,我对Sinatra/Ruby/Apache很陌生,但是已经继承了Sinatra应用程序进行部署.
Now I am pretty new to Sinatra/Ruby/Apache but have inherited a Sinatra application to deploy.
当前,Apache已设置为从文档根目录(httpdocs)运行,并且我需要在文件夹子目录(例如/httpdocs/webapp
Currently Apache is set up to run from a document root (httpdocs) and I need to run a ruby application underneath a folder subdirectory such as: /httpdocs/webapp
我需要做什么才能使其在子目录下运行?
What do I need to do to get this up and running under a subdirectory?
推荐答案
此链接可能会有所帮助,它说明了如何使用Passenger(mod_rack)在Apache上部署Sinatra应用程序:部署带有Apache和Phusion Passenger的Sinatra App
This link might be helpful, it explains how to deploy a Sinatra app with Apache using Passenger (mod_rack):Deploying a Sinatra App with Apache and Phusion Passenger
您特别感兴趣的部分是虚拟主机配置中的RackBaseURI
选项.官方文档可在此处获得: Phusion乘客用户指南-将机架部署到Sub URI
The part of particular interest to you is the RackBaseURI
option in the virtual host configuration. The official documentation is available here:Phusion Passenger users guide - Deploying Rack to Sub URI
这篇关于设置Sinatra以在子目录中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!