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 8076071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:11:11+00:00 2026-06-05T15:11:11+00:00

I am developing a web app that will have two parts running on two

  • 0

I am developing a web app that will have two parts running on two separate domains (RoR at mydomain.com and another server at sub.mydomain.com). When developing locally, I can run the apps on localhost:port1 and localhost:port2.

In order to test, it’d be convenient to modify my /etc/hosts file to work as such:

mydomain.com -> localhost:port1
sub.mydomain.com -> localhost:port2

Is there a way to do this? What do people suggest doing to develop both at the same time?

  • 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-06-05T15:11:12+00:00Added an answer on June 5, 2026 at 3:11 pm

    The hosts file is completely unaware of TCP ports.
    It is for name to layer 3 resolution only.

    The solution posted by mfussenegger is interesting, but I think the easier question to ask is this:
    Why is it necessary to run these on separate ports?
    Using any web server that supports HTTP 1.0, you can simply define the host header for each site to be the domain name of that site, and the requests will be routed to the appropriate site.

    Your hosts file would have both entries just pointing to localhost.

    Link to apache documentation on how to configure this:
    http://httpd.apache.org/docs/2.2/vhosts/examples.html

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

Sidebar

Related Questions

We are developing a web app that will have a pretty complex user and
This is the scenario i have: im developing a web app that will list
We are developing the Web App that will have user subscription to a specific
I'm developing a full-screen web app for an iPad that will have a series
I am developing a web app (using rails) that I will be launching within
I'm developing a web app (A) that serves as a front-end to another website
I'm developing a QA web-app which will have some points to evaluated assigned to
I'm developing a web app that will show the location of a project in
We are developing an ASP.NET MVC web app that will be hosted on Windows
Im developing a Rails app that will contain a web front end as well

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.