Search code examples
ruby-on-railsapachepassengerwebrick

Phusion Passenger Rails server - how to access from outside?


I switched from WEBrick to Phussion Passenger following this guide: http://developer.apple.com/library/mac/#featuredarticles/PhusionRails/index.html. I used PassengerPane to configure it.

Now I can access my app at myapp.local, instead of localhost:3000

However, I don't know how to access it from the outside. It used to be ip:3000

My vhost.conf file looks like this:

<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>

Solution

  • You need to add 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>
    

    You can add as many aliases as you want (with real domain names for example).