Phusion Passenger Rails服务器 - 如何从外部访问?

时间:2011-03-03 11:26:04

标签: ruby-on-rails apache passenger webrick

我按照本指南从WEBrick切换到Phussion Passenger:http://developer.apple.com/library/mac/#featuredarticles/PhusionRails/index.html。 我使用PassengerPane来配置它。

现在,我可以通过 myapp.local 访问我的应用,而不是 localhost:3000

但是,我不知道如何从外面访问它。它曾经是 ip:3000

我的vhost.conf文件如下所示:

<VirtualHost *:80>
  ServerName myapp.local
  DocumentRoot "/Users/martin/myapp/public"
  RackEnv development
  <Directory "/Users/martin/myapp/public">
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

1 个答案:

答案 0 :(得分:0)

您需要添加ServerAlias YOURIP

<VirtualHost *:80>
  ServerName myapp.local
  ServerAlias YOURIP
  DocumentRoot "/Users/martin/myapp/public"
  RackEnv development
  <Directory "/Users/martin/myapp/public">
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

您可以根据需要添加任意数量的别名(例如,使用真实域名)。