2 servers on 1 ip

Posted on 2005-04-30
Last Modified: 2012-05-05
Right now i'm on a cable connection, with a dlink router and a single apache2 server running. I want to put another server up, on the same ip. What would be the easiest way to do that? Can I setup a virtual host in apache on the already existing server to point to an internal ip on the network? or is there an easier/more efficient way to do this?
Question by:engel32
    LVL 19

    Expert Comment

    yes, you can do it using Name based Virtual hosts. I use it on my PC. I have two sites running on the same IP.
    Example of config:
    Listen 80
    NameVirtualHost *:80
    <VirtualHost *:80>
        DocumentRoot "c:/web/site1"
        ErrorLog logs/server1-error_log
        CustomLog logs/server1-access_log combined

    <VirtualHost *:80>
        DocumentRoot "c:/web/site2"
        ErrorLog logs/server2-error.log
        CustomLog logs/server2-access.log combined

    Keep in mind that you should have two correct DNS names that point to the same IP address. You can do it using domain. They offere DNS names for free.
    LVL 2

    Author Comment

    hmm.. don't think that was interpreted correctly..  I already have plenty of virtualhosts setup for subdomains and alt domains.. but I want to run 2 completely different servers on 2 completely different computers, but we only have the 1 ip coming into the network...  I just need a temp fix til we go to dsl and can have more than 1 ip.
    LVL 19

    Accepted Solution

    you can try to use proxy module of Apache. So you create new virtual host on your existing Apache server, but add ProxyPass parameter which will retrive data from another webserver:
    ProxyRequests on
    ProxyPass /

    Example config
    details on

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now