[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: how to setup virtual hosts in apache web server



kamesh jayachandran forced the electrons to say:
> I want to know how to setup virtual host addresses like somename.domain.com 
> without actually associating separate ip address for that subdomain and 
> asociate the same ip address as that of domain.com.
> Thanks in advance
> kamesh jayachandran

Hi,

I don't get what you are trying to say here.

If you want to have many domains on the same machine with more than
one network interface, it is simple. Any document on gateway servers
that you can find will help you. Configure every interface the way you
want it - eth0 as yourfirstdomain.com, eth1 as your seconddomain.com,
ppp0 as whatever your ISP assigns you and so on. To configure ethernet
interfaces, use the ifconfig command as:

ifconfig eth0 192.168.100.1 netmask 255.255.255.0 broadcast 192.168.100.255

If you want one interface to serve many domains, you need to enable
aliasing.  I know only about ethernet interface, but it is enough to
get you going. You setup an alias for your eth0 interface - eth0:0 with
a different IP address and a different domain. Do it as:

ifconfig eth0 192.168.100.1 netmask 255.255.255.0 broadcast 192.168.100.255
ifconfig eth0:0 192.168.200.1 netmask 255.255.255.0 broadcast 192.168.200.255

And assign different names to these two IP addresses (via resolver -
run DNS).

If you want multiple names on the same interface without even aliasing,
then it is going to be difficult. You probably will have to tweak with
individual service configuration (httpd, sendmail and such). If you want your
sendmail to accept mails for both firstdomain.com and seconddomain.com, add
these two domains in /etc/sendmail.cw and /etc/mailusertable (read the
documentation of sendmail). For httpd, the file to edit is
/etc/httpd/conf/httpd.conf. Note that these names should be resolvable - you
must be running DNS and in the case of sendmail, the two domains must have MX
records also.

Hope this helps you,

Binand
---
Send e-mail to 'ilugc-request@xxxxxxxxxxxxxxxxxx' with 'unsubscribe' 
in either the subject or the body to unsubscribe from this list.