문제

요약 된대로 Mac OSX에서 하위 도메인을 성공적으로 실행하고 있습니다. 레일에 로비. 아래의 예제 코드를 따르고 싶지만 어디서부터 시작 해야할지 모르겠습니다. DNS 설정을 어떻게 편집합니까? 이 작업을 수행하려면 전용 가상 호스트가 있어야합니까? 지금은 표준 (Crappy) Dreamhost 공유 호스팅이 있습니다. 내가 DVH와 함께 가면 미디어 템플이 좋은 선택입니까?

모든 미디어 REC가 도움이 될 것입니다. 내 Google 검색은 화난 고객/호스팅 회사 타이레이드 만 초래했습니다.

감사!

# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
#   ServerName example.com
#   ServerAlias *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base
  before_filter :set_current_account

  private
    def set_current_account
      @current_account = Account.find_by_subdomain!(request.subdomains.first)
    end
end

# 4) Tie all top-level requests off the current account
class CustomersController < ApplicationController
  def index
    @customers = @current_account.customers
  end
end
도움이 되었습니까?

해결책

나는 와일드 카드 DN을 지원하는 Heroku와 비슷한 일을합니다. DNS 처리를위한 다양한 옵션이 있습니다. 대부분의 경우 실제로 이름 서버를 관리하는 사람이 처리합니다.

DreamHost는 요청시 WildCard DNS 호스팅을 허용합니다 ... 기본적으로 그들은 이름 서버를 사용하여 들어오는 요청을 처리하므로 이메일을 보내는 것 외에는 그리 많지 않습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top