Apache

I want to have multiple domains to be configured in apache web server on redhat linux

can i have that without DNS server being configured. What all i have to do for that.What all to configure ?

please note that i need to access the site by its name not by IP . I want this in a LAN . I dont want to be accessed by internet.

Please help me

Vijay

you can achieve this by using virtual hosts.

the first step is enable bindaddress in httpd.conf file, so that is listen to ip address or url

BindAddress *

the second step is to place an ip address in the NameVirtualHost that is

NameVirtualHost xx.xx.xx.xx

virtualHost xx.xx.xx.xx
ServerName www.mydomain.com

virtualHost xx.xx.xx.xx
ServerName www.myseconddomain.com

Note:
xx should be an ip address.
you will only be able to access the web site only through an iP address without configuring DNS

Vijay,

It looks as if you are trying to host a web site on your home box, is this correct?

If it is then 1) does your connection have a static IP address, 2) does your domain registrar offer name server support (buy this I mean will they let you change the IP address of the domain on their name server - thus solving your dns issue - I dont think many will).

If both of the above are true then you can log in to your registrar and say domain "www.a.com" = ip address "123.123.123.123" (your box). Then you can configure apache as discribed by the other people in Unix.com to set up virtual hosts (so effectivly you can put as many web sites on one address as you like).

If the answer to the questions is no then you have to look at something like "www.easydns.com", they provide redirection to dynamic IP address's (I am sure there are other people that do this but they where at the top of the google search).

W

uhhh... he doesnt need to know anything about his ISP provided IP address if he only wants to be accessed by his local network.
What needs to be done is make sure that your clients know that your.local.server = 192.168.0.1 and make a virtual host in httpd.conf for your.local.server.
I know that doesnt help very much because i am not quite sure how to achieve this myself.

Fridge,

Sorry Vijay only added the "lan" bit after I had replied, hence why my reply looks a bit mad.

Vijay, The way to do this is to create a hosts entry on each of the boxes that you want to connect to the Apache server.

In *nix this would be in the file /etc/hosts
in Windows (at least in Nt and 2000 [not sure about the rest]) it is in "windows"\system32\drivers\etc\hosts

Basicly you have server "a.a.a.a" (you apache server) that you want to run domain "www.test.com"

you add a line in the host file:

a.a.a.a www.test.com (and optional) test.com

If you want to add more than one;

a.a.a.a www.test.com www.test1.com www.test2.com

Then you still have to set-up virtual hosts so that when the request hits your apache it knows which directory to serve your request from.

W