问题
I want to deploy multiple rails app on a single server. If I had a domain name, I would have easily done that using subdomains as server name in virtual hosts.
My problem is that I do not have a domain name. Can I do something like
70.42.89.11/app_1 as one server name and 70.42.89.11/app_2 as another.
Or are there any other solutions?
回答1:
Yes. The Passenger guide calls this "Deploying to a Sub URI"
http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rack_to_sub_uri
https://www.phusionpassenger.com/library/deploy/apache/deploy/ruby/#deploying-an-app-to-a-sub-uri-or-subdirectory
回答2:
Additionally, you could set up a standard virtual host setup and use your hosts file to make up a domain you like. This would only work for testing of course, as anyone who wanted to see the apps would need to have the same entries in their hosts file, but would be fine for development.
Domains don't need to be hosted in the domain name system to be useable for virtual hosting.
来源:https://stackoverflow.com/questions/3922454/how-to-deploy-multiple-rails-app-on-a-single-ip-apache-passenger