Vitural Hosts are good becuase many Domain Names can be used on one machine. This allows one domain to sell space to others who do not have the means or knowledge to have a machine of their own to place their domain on.
| Name | IP NUMBER |
| my.webcube.com | 123.456.789.10 |
| bigdog.com | 123.456.789.20 |
The script Makezone can be used to automate the following instructions. If you use this program you will not need to do any of the following information below. However, you should be aware of the steps that are required to create a virutal domain.
In the directory /etc/sysconfig/virtual-domains you need to create filenames virtual-domain-00 In which you place thefollowing.
IPADDR=123.456.789.20 HOSTNAME=www.pacnet.comIPADDR should be equal to the IP number of the new domain. Just use a number that you were assinged but have not used yet.
HOSTNAME should be the new name that you registerd with InterNic.
Then you can continue to create the files virtual-domain-xx. Where xx is equal to the number in progression from 01 to 99.
You now should skip down to the next section.
We highly reccommend you download pcn_update 0.9.10 now and then follow the easy instructions on how to do Id Aliasing with the patch.Type "ifconfig" at the bash prompt and will will see something like this:
lo Link encap:Local Loopback inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0 UP BROADCAST LOOPBACK RUNNING MTU:2000 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 TX packets:198176 errors:0 dropped:0 overruns:0 eth0 Link encap:10Mbps Ethernet HWaddr 00:A0:24:56:4D:D0 inet addr:204.140.249.15 Bcast:204.140.249.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:67622 errors:0 dropped:0 overruns:0 TX packets:79500 errors:0 dropped:0 overruns:0 Interrupt:11 Base address:0x6000 dummy0 Link encap:10Mbps Ethernet HWaddr 00:00:00:00:00:00 inet addr:192.0.0.1 Bcast:192.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 TX packets:0 errors:0 dropped:0 overruns:0Write down the "HWaddr" number in the eth0 section. You will need it in the next step.
Edit the /root/multip.scrpt file.
Here is an example of how it might look:
All lines that begin with # are comments and are not read by the computer.#!/bin/sh #Set Variables HDWR_ADDR="00:A0:24:56:4D:D0" # Hardware address of ethernet device # IP_ADDR_0="123.456.789.20" # 1st Dummy IP #IP_ADDR_1="123.456.789.21" #2nd Dummy IP #IP_ADDR_2="123.456.789.21" #3rd Dummy IP #IP_ADDR_3="123.456.789.21" #4th Dummy IP #IP_ADDR_4="123.456.789.21" #5th Dummy IP #IP_ADDR_5="123.456.789.21" #6th Dummy IP #IP_ADDR_6="123.456.789.21" #7th Dummy IP #IP_ADDR_7="123.456.789.21" #8th Dummy IP #IP_ADDR_8="123.456.789.21" #9th Dummy IP #IP_ADDR_9="123.456.789.21" #10th Dummy IP # #Install modules - as many a you need /sbin/insmod -o dummy0 /lib/modules/1.2.13/net/dummy.o /sbin/insmod -o dummy1 /lib/modules/1.2.13/net/dummy.o #Install modules #First device /sbin/ifconfig dummy0 ${IP_ADDR_0} up /sbin/route add ${IP_ADDR_0} dummy0 /sbin/arp -s ${IP_ADDR_0} ${HDWR_ADDR} pub #Second device #/sbin/ifconfig dummy1 ${IP_ADDR_1} up #/sbin/route add ${IP_ADDR_1} dummy1 #/sbin/arp -s ${IP_ADDR_1} ${HDWR_ADDR} pub #Third device #/sbin/ifconfig dummy1 ${IP_ADDR_2} up #/sbin/route add ${IP_ADDR_2} dummy1 #/sbin/arp -s ${IP_ADDR_2} ${HDWR_ADDR} pub . . . #tenth device #/sbin/ifconfig dummy1 ${IP_ADDR_9} up #/sbin/route add ${IP_ADDR_9} dummy1 #/sbin/arp -s ${IP_ADDR_9} ${HDWR_ADDR} pubNote how the value of HDWR_ADDR is equal to the HWaddr from above. Change your HDWR_ADDR to equal yoru HWaddr. You will only have to do this step ONCE and never need to do it again.
Now look at the IP_ADDR_0 line above. Notice how it is set to the IP number of bigdog.com? Change IP_ADDR_0 to equal your new virtual domain's IP-number.
When you create a second, third, or fourth virtual domain, Simply add the new domains IP number to the next IP_ADDR line and uncomment it and also uncomment the next device section.
Type 'virtual-domain-down' to remove all domains.
Then type 'virtual-domain-up' to start up the process again.
type 'rmmod dummyNUMBER' (where NUMBER is then number of the dummy process.)Test by pinging the new virtual domain's ipnumber. (ex: 'ping 123.456.789.20')
type 'multip.scrpt'
Look inside the /etc/named.boot file and find out where your DNS files are.
;sample /etc/named.boot file. This file is not complete. ;boot file for name server ; directory /etc
The above example shows that all DNS files are located in the /etc directory. Due to the fact that the /etc directory has many files placed in it by default, I recomend that you create the directory /etc/namedb and place all your DNS files there. This makes it easier for you to keep track of all your virtual domain zone files.
Change your /etc/named.boot file to make your directory /etc/namedb by changing the above line to directory /etc/namedb. You then must copy all the DNS files (named*) and exsisting virtual domain zone files to your /etc/named directory.
cp /etc/named* /etc/namedb
In the file /etc/named.boot we want to add our new domain.
primary bigdog.com bigdog.com
;
;
@ IN SOA bigdog.com. hostmaster.bigdog.com. (
5 ; Serial number
172800 ; Refresh every 2 days
3600 ; Retry every hour
1728000 ; Expire every 20 days
172800 ); Minimum 2 days
;
IN NS my.webcube.com.
;
bigdog IN A 123.456.789.20
;
www IN A 123.456.789.20
ftp IN A 123.456.789.20
nntp IN A 123.456.789.20
;
bigdog.com. IN A 123.456.789.20
Everytime you change this file, you need to change the serial number or it will not be updated by the DNS. Just add 1 to the number.
In the line
IN NS my.webcube.com
whois your.domainname.com
You record should look something similar to this:
[root@pacnet /root]# whois pacnet.com
[rs.internic.net]
Pacific Internet (PACNET-DOM)
600 Corporate Point, Suite 100
Culver City, CA 90230
USA
Domain Name: PACNET.COM
Administrative Contact:
Hipsher, Garry (GH54) garry@TRANTECH.COM
310.215.8040 (FAX) (310) 215-8070
Technical Contact, Zone Contact:
Gomberg, Michail (MG391) michail@SOFTAWARE.COM
310-305-0275
Record last updated on 17-Oct-95.
Record created on 18-Nov-94.
Domain servers in listed order:
GREENLAND.TRANTECH.COM 204.140.249.4
EUROPE.TRANTECH.COM 204.140.249.11
Next I reccomend that you create a file named IP-NUMBERS in the same direcotry that will contain ALL of the IP-NUMBERS with each of their domain names that are on your system. Place the new domain name and IP number in a list in Numerical Order. This will not be accessed by any program but will help you keep track of your ip numbers as your domains grow. An entry may look like this:
123.456.789.10 bigdog.com
Now type named.restart to restart the name deamon.
The file httpd.conf needs to have some virtualhosts added to the bottem of it. Here is an example with bigdog.com:
<VirtualHost bigdog.com> ServerAdmin webmaster@bigdog.com DocumentRoot /usr/local/html/bigdog.com ServerName bigdog.com ErrorLog /var/log/bigdog.com-error_log TransferLog /var/log/bigdog.com-access_log </VirtualHost>The DocumentRoot entry is a directory. "bigdog.com" is the name of the directory in the /usr/local/html directory that you are going to place all of bigdog.com's html files. Make sure you create a directory in /usr/local/html with the name you place here.
Add a new VirtualHost section for each virtual domain on your system. If you would like to learn more about the httpd.conf file, please visit http://www.aha.ru/docs/apache/httpd.conf.html.
Now type 'killall httpd; httpd' to restart the http deamon.
Here is a sample sendmail.cw file for our fictious machine.
After you have edited your sendmail.cw file and added the line or lines containing the new virtual domain name you need to shutdown and restart the sendmail program by typeing:# sendmail.cw - include all aliases for your machine here. webcube.com my.webcube.com bigdog.com
/etc/rc.d/init.d/sendmail stop
/etc/rc.d/init.d/sendmail start
This is defined in the /etc/srm.conf file as the line DocumentRoot
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
DocumentRoot /usr/local/html/main/
Type: ll /usr/local/html and see if the file is a symbolic link or not.
If the file looks like:
drwxrwxr-x 2 root root 1024 Jun 10 19:24 main/
Then it is a DIRECTORY and you are ready to upload your web pages to /usr/local/html/main. You do not need to do anything further.
If the file looks like:
Then it is a link and needs to be destroyed.
follow the commands below to destroy the link and create a directory.