[英]Issues with deploying a Rails app in a subdomain (Apache and Passenger)
[英]Rails app dynamic subdomain not working on apache and passenger
同一个问题被多次询问,但还没有可行的答案,而且可用的答案只支持硬编码的子域:
我在rails 3.2.13应用程序中应用了动态子域 ,并使用lvh.me而不是localhost指定的本地工作。
我的网址就像
本地
subdomain.app_name.lvh.me:3000/
在porduction:
subdomain.app_name.abc.com/
我的网站是appache + passenger
似乎appache没有向乘客转发请求。
我错过了什么吗?
我按照这个http://railscasts.com/episodes/221-subdomains-in-rails-3
注意:
我不需要硬编码的子域,因为它们将在动态和广泛的级别生成。
1)在您的DNS设置*.abc.com
指向您的服务器。
2)设置Apache vhost以捕获星形指针:
<VirtualHost *:80>
ServerName abc.com
ServerAlias *.abc.com
DocumentRoot /home/public_html/yourapplication/current/public
</VirtualHost>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.