Pick a Free OS

Web server tutorial - Part 3

<VirtualHost 192.192.192.1>

DocumentRoot /htdoc

ServerName sudhir.linux.com

ErrorLog /home/err

</VirtualHost>

<VirtualHost 192.192.192.1>

ServerName chiku.linux.com

DocumentRoot /chiku

</VirtualHost>


Remember the entire directory in documentroot has to be manually created.


In above case /htdoc,/chiku,/docfile directory has to be created and each directory will have index.html in each DocumentRoot specified. The above-mentioned thing is done.

Independent Hosting

ifconfig eth0:1 192.192.192.2

ifconfig eth0 :2 192.192.192.3

ifconfig eth0:3 192.192.192.4


In this case the directive is BindAddress *

<VirtualHost 192.192.192.2>

DocumentRoot /doc

ServerName goldie.linux.com

ErrorLog logs/err

</VirtualHost>


<VirtualHost 192.192.192.3>

DocumentRoot /htoc

ServerName sudhir.linux.com

ErrorLog /home/err

</VirtualHost>

<VirtualHost 192.192.192.4>

ServerName chik.linux.com

DocumentRoot /chik

</VirtualHost>

DNS Effect

Now in both the cases the DNS have to be upated in following way:

Assuming domain linux.com and machine kshounish1, see the following change

invi /var/named/linux.com.

IN SOA kshounish1.linux.com root.kshounish1.linux.com (

2000011602 ; serial

3600 ; refresh

900 ; retry

1209600 ; expire

43200 ; default_ttl

)


@ IN NS kshounish1.linux.com.

kshounish1 IN A 192.192.192.1

sudhir IN A 192.192.192.1

chiku IN A 192.192.192.1

goldie IN A 192.192.192.1

sudhu IN A 192.192.192.2

gold IN A 192.192.192.3

chik IN A 192.192.192.4


Then vi /var/named/192.192.192.reverse

@ IN SOA kshounish1.linux.com root.kshounish1.linux.com (

2000011601 ; serial

3600 ; refresh

900 ; retry