regarding virtual hosting

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
claws
Forum Commoner
Posts: 73
Joined: Tue Jun 19, 2007 10:54 am

regarding virtual hosting

Post by claws »

it needs to be told to listen on specific ports, or to listen on only selected addresses, or a combination.
Listen 192.170.2.1:80
Listen 192.170.2.5:8000
but an IP address is assigned to a PARTICULAR MACHINE.
(like in my lan. i am assinged 10.108.7.56 by DHCP or i can manually fix my ip address(not addresses) .)
is it that a single machine can have multiple ip addresses?
if yes then there is no point in the concept of VIRTUAL Hosting.
if no, then what does the above two Listen directives say. I mean How can apache server running on machine(192.170.2.1) listen on a different machines(192.170.2.5)

httpd.apache.org/docs/2.2/vhosts/name-based.html
In the normal case where any and all IP addresses on the server should be used, you can use * as the argument to NameVirtualHost.
what does this "all IP addresses on the server" means??


now on my computer localhost(127.0.0.1) can i have a virtual host environment??
if no, then where can get feel of it?

[/u]
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: regarding virtual hosting

Post by VladSun »

claws wrote:is it that a single machine can have multiple ip addresses?
Absolutely :) My server has 5 different IP addresses.

claws wrote:if yes then there is no point in the concept of VIRTUAL Hosting.
if no, then what does the above two Listen directives say. I mean How can apache server running on machine(192.170.2.1) listen on a different machines(192.170.2.5)
Normally, there is one instance of Apache server running - if you have IP based Virtual Hosts configuration, then when Apache receives a request, it looks at its destination IP and decides which virtual host has to serve the request.
claws wrote:httpd.apache.org/docs/2.2/vhosts/name-based.html
In the normal case where any and all IP addresses on the server should be used, you can use * as the argument to NameVirtualHost.
what does this "all IP addresses on the server" means??
It means "all IP addresses assigned to the server" :)
claws wrote:now on my computer localhost(127.0.0.1) can i have a virtual host environment??
if no, then where can get feel of it?
Yes, you can :)

For windows - go to network properties, choose your network adapter, choose TCP/IP properties, choose Advanced button and add the desired IP :)

For Linux - supposing you have eth0 interface up, execute the following command:

Code: Select all

ifconfig eth0:1 your.new.ip.here
ifconfig eth0:2 your.second_new.ip.here ...
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply