我在运行 centos 6 的机器上安装了 rails 4 应用程序。我让 Apache 提供另一个应用程序,并尝试在子 uri 上安装 rails 应用程序。为了帮助部署,我安装了 Passenger。以下是我的主要 httpd 配置文件:
#CKAN
WSGISocketPrefix /var/run/wsgi
#RAILS Passenger
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.2@ohana-api/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-2.1.2@ohana-api/gems/passenger-4.0.50
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.1.2@ohana-api/wrappers/ruby
</IfModule>
<VirtualHost 0.0.0.0:80>
ServerName xyz.clacksweb.org.uk
ServerAlias xyz.clacksweb.org.uk
WSGIScriptAlias / /etc/ckan/default/apache.wsgi
# Pass authorization info on (needed for rest api).
WSGIPassAuthorization On
# Deploy as a daemon (avoids conflicts between CKAN instances).
WSGIDaemonProcess ckan_default display-name=ckan_default processes=2 threads=15
WSGIProcessGroup ckan_default
ErrorLog /var/log/httpd/ckan_default.error.log
CustomLog /var/log/httpd/ckan_default.custom.log combined
#RAILS PASSENGER STUFF
DocumentRoot /home/ohana/repos/ohana-api/public
<Directory /home/ohana/repos/ohana-api/public/>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
# Require all granted
</Directory>
# These have been added:
Alias /ohana /home/ohana/repos/ohana-api/public
<Location /ohana>
PassengerBaseURI /ohana
PassengerAppRoot /home/ohana/repos/ohana-api
</Location>
</VirtualHost>
当我访问 /ohana 子 uri 时,出现 403 禁止错误:“您无权访问此服务器上的 /ohana/。”
我尝试将应用程序的所有者和组从 ohana 用户切换为 root,然后再切换回来。我还应该检查什么?