【发布时间】:2012-03-18 02:04:15
【问题描述】:
我正在从 Dreamhost 切换到 Rackspace Cloud 托管,因为前者处理 Rails 应用程序的能力还有一些不足之处。我已经设置了一个 CentOS 服务器,我已经部署了我的 rails 应用程序并且域解析,一切都很好。现在我想设置它,所以如果我直接访问 IP 地址,我将获得正常的 apache 目录而不是 rails 应用程序。我以为虚拟主机可以管理这个,但现在他们都去rails页面或apache页面,视情况而定
<VirtualHost *:80>
ServerName 123.456.789.101
DocumentRoot /var/www/html
</VirtualHost>
<VirtualHost *:80>
ServerName mywebsite.com
ServerAlias www.mywebsite.com
DocumentRoot /rails/myapp/current/public
<Directory /rails/myapp/current/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
我不太确定如何进行,或者这只是不可能开始。想法?
【问题讨论】:
-
使用基于名称的虚拟主机?并让 apache.mywebsite.com 指向 apache 页面,或类似的东西。并让 www 指向您的 rails 应用程序。
标签: apache2