Click to See Complete Forum and Search --> : Virtual host


Smooda
05-04-2003, 08:13 PM
hi
Im kinda new on linux but trying to figure it out.
Im gonna post first what i have and then what i want :
i got a server running redhat and i bout a domain from a company.Then i asked the company that is hosting my server to add to the server's ip the domain name i bought and registered.
So i have the ip (lets say 205.178.39.1) from the isp that is hosting my server and the domain name (lets say bleh.net).
Now the Isp gave me an additional two(2) which i intended to use for vitual hosts.
a) I have added in /etc/hosts the ips and domain names i wanted
i.e: 127.0.0.1 localhosts.localdomain.localhost
205.178.39.1 bleh.net
205.178.39.2 bla.bleh.net
205.178.40.12 another.notexisting.vhost.net

b) did the apropriate on /etc/sysconfig/networkNETWORKING=yes
#HOSTNAME=localhost.localdomain
HOSTNAME=bleh.net

Now what i want is to set up the other 2 ips to some virtual hosts,or even set some virtual hosts to the main ip.Thing is,i dont know how.
any explaination would be apreciated,thanx

bwkaz
05-04-2003, 10:52 PM
Virtual hosts must point at the same IP address (otherwise they're not virtual, they're real, separate hosts ;)).

That said, vhosting is a function of the server program you're using. Apache 2 has a nice set of documentation on how to set it up, linked somewhere off http://httpd.apache.org -- take a look around.

Smooda
05-05-2003, 01:38 PM
hi..I have looked at the url and tried to do whatever i inderstood(which wasnt much).I think that page is for users who have a greater idea about linux and not for newbies.If there was a wa to have step by step guidness and actually name files and directories where things can be done,i would apreciate.
thanx ;)

bwkaz
05-05-2003, 02:51 PM
So I assume you looked at the examples page?

http://httpd.apache.org/docs-2.0/vhosts/examples.html

That's for Apache 2 -- since you've provided very little information on your software setup, I have no idea if this is the right version of Apache or not.

I also don't have a clue how your Apache was configured, or where your config files are at. They might be somewhere under /etc, or they might be somewhere totally different. It's at the whim of whoever created your Apache package.

cowanrl
05-06-2003, 06:54 AM
Are you wanting to have a separate NIC for each IP address or are you wanting to assign the 3 IP addresses to the same NIC?

Smooda
05-07-2003, 01:47 AM
ok,here's the complete story.
I have registered the domain from companyA.I got a server and hosting in companyB.company B gave me 3 ips,1 main and 2 secondary.I asked company B to asign the main ip to my domain.
they have done so. i have asigned ip to domain (etc/hosts )i have set resolv.conf to the name servers of comapanyb and adjusted "Hostname" and all in /etc/sysconfig/network.Also did what was needed for ifconfig.

Now,my httpd.con file is in /etc/httpd/conf/httpd.conf .

reading and re-reading the manuals ,the only thing i can find that can explain why the vhosts are not working is maybe because the hostname i registered doesnt alway resolve.

while doing "dig mydomain.net" from this box i see it resolves to an ip belonging to companyA from where i registered the domain.doing a reverse shows the same.
When performing that command from my other linux box which is on a different Isp and different country, dig mydomain shows the ip i have in my /etc/host ,but reverse does shows the first name companyB had on that box.Weird uh?

So all i can think of is that the virtual hosts dont work maybe because the main domain doesnt?

Im completly lost atm.