开发者

How to deploy multiple rails apps on one domain without symbolic links

开发者 https://www.devze.com 2023-02-10 03:40 出处:网络
According to the passenger documentation it is possible to deploy multiple rails apps on one domain by setting a central rails app and then link in other apps by creating symbolic links in the public

According to the passenger documentation it is possible to deploy multiple rails apps on one domain by setting a central rails app and then link in other apps by creating symbolic links in the public directory of this app (and tell the webserver about it).

This is actually pretty messy. Is there a way to achieve this behaviour just with the webserver configuration? I am using apache2 with mod_rails.

What i want is the following:

myapp.subdomain.domain.tld myapp.subdomain.domain.tld/staging myapp.subdomain.domain.tld/development

Where each of the URLs point to a different rails开发者_JAVA百科 project which reside in the following directories on the server:

/var/www/myapp/production/current/public /var/www/myapp/staging/current/public /var/www/myapp/development/current/public

In this scenario i would need to place the symbolic links in the public folder of the production folder, which is not what i want (it feels very dirty). It might even be that these projects will later reside on different servers.


All you need is to enable mod_alias and use alias directive to map different locations myapp.subdomain.domain.tld will map by default to the location as defined in the document root then for myapp.subdomain.domain.tld/staging use the directive

Alias staging /var/www/myapp/staging/current/public 

for myapp.subdomain.domain.tld/development use the directive

Alias development /var/www/myapp/development/current/public 

For further informations, take a look at the following mod_alias doc : http://httpd.apache.org/docs/2.0/urlmapping.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号