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

I frequently work with multiple instances of Visual Studio, often working on different branches
We have a setup where we have multiple instances of an application - one
With multiple developers working on the same Tomcat application, I'd like to tell the
Python works on multiple platforms and can be used for desktop and web applications,
I have multiple projects in a couple of different workspaces. However, it seems like
If I had a web shop application and I'd want to provide it to
I am working on a web application using ASP.NET 3.5. The application has hundreds
Our customer experienced multiple errors on a demonstration to a customer of theirs. The
How can I exclude multiple columns when creating a new customer? The other column
I am working on a customer sign-up workflow. As expected, there are multiple steps

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.