2 servers on 1 ip

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?
LVL 2
engel32Asked:
Who is Participating?
 
ramazanyichCommented:
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 / http://foo.com/

Example config
details on http://httpd.apache.org/docs/mod/mod_proxy.html#proxypass
0
 
ramazanyichCommented:
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"
    ServerName server1.dnsalias.net
    ErrorLog logs/server1-error_log
    CustomLog logs/server1-access_log combined
</VirtualHost>

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

Keep in mind that you should have two correct DNS names that point to the same IP address. You can do it using dnsalis.net domain. They offere DNS names for free.
0
 
engel32Author Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.