Apache PHP和Rails在子目录中


Apache PHP and Rails in subdirectory

我需要在子目录中设置rails,phusion-passenger php在根目录中。我让它工作,但rails静态文件是404。apache配置如下:

<DirectoryMatch "^/home/folder_name/public/invite/*">
SetEnv GEM_HOME /home/folder_name/.gems
PassengerEnabled On
PassengerAppRoot /home/folder_name/public/invite
RailsEnv production
PassengerBaseURI /invite
</DirectoryMatch>
<DirectoryMatch   "^/home/folder_name/public/invite/public/*">
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</DirectoryMatch>

有人有主意吗?

我不熟悉DirectoryMatch,但它需要一个正则表达式。看起来更像这样:

<DirectoryMatch "^/home/folder_name/public/invite/public/.*">