Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 558833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:10:24+00:00 2026-05-13T12:10:24+00:00

Multiple customer instances of an application, under a single application. What I need is

  • 0

Multiple customer instances of an application, under a single application.

What I need is to allow multiple users, to connect to my Apache Web server, by passing different url like :
customer1.myhost.com
company1.myhost.com
company2.myhost.com
etc.

What I want my Apache server to do, is pass all request that are not directed to a certain list of existing hosts
(like trac.myhost.com and https://myhost.com) over to my Rails application, by setting a RequestHeader to identify the requested host, something like :

RequestHeader “INSTANCE_NAME” = customer1 #for customer1.myhost.com

Thanks for your help!

Ps.: The end goal is to offer software slices as a service, but having all those customers managed under 1 application running. Not 1 app per customer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:10:25+00:00Added an answer on May 13, 2026 at 12:10 pm

    Using a standard VirtualHost configuration you can do this:

    NameVirtualHost *:80
    
    <VirtualHost *:80>
      ServerName app.example.com
      ServerAlias *.example.com
    
      DocumentRoot /web/app.example.com/public
    </VirtualHost>
    

    This will capture all requests that are not already captured by other VirtualHost entries.

    When your application receives the request, you will have the request variable set with the host-name provided. This is available to any ActionController:

    request.host
    

    From there you can load the appropriate data in some kind of before_filter, as is typically done like:

    before_filter :load_client
    
    def load_client
      @client = Client.find_by_hostname!(request.host)
    rescue ActiveRecord::RecordNotFound
      render(:partial => 'client_not_found', :status => :not_found)
    end
    

    So long as the client has the hostname populated correctly, this will find them on each page load.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have a customer who can have multiple locations. When you
I am creating an application to be accessed by multiple clients, but each customer
I would like to build an application that connects to multiple databases. A customer
I have multiple web applications (PHP) which are being served to different customers from
Multiple NSURLConnections being started (in a single UIViewController) to gather different kinds of data.
I have two tables, Customer and CustomerPhone. Single record in Customer can have multiple
I have an ASP.NET MVC2 application where I need to support not only multiple
We have a setup where we have multiple instances of an application - one
So I need to create a customer system and there aren't multiple types of
Let's say customer is adding multiple products to cart. Add car, apartment, tour, some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.