Previous Page | Next Page

  1. Agustin's Linux Manual
  2. Networks & Servers
  3. About the Author
  4. Table of Contents
  5. IP Addresses Networks and Subnets
  6. Network Classes
  7. IP Address in Decimal Notation
  8. Sub-netting
  9. Designing Subnets
  10. Allocating Subnets
  11. Defining Host Addresses
  12. Variable Length Subnet Mask
  13. Routing Protocols
  14. Classless Internet Domain Routing
  15. Servers - Chapter 9
  16. Apache Web Server
  17. Configuring Apache
  18. Uploading Web Pages
  19. Apache Overview
  20. MIMEMagic
  21. DNS Servers
  22. Welcome to Webmin
  23. Creating the Master Domain
  24. Adding the Reverse Zone
  25. Querying the DNS server
  26. Adding Virtual Domain to DNS Server
  27. Reverse Zone for Virtual Zone
  28. Binding IP Address for Virtual Domain
  29. Virtual Web Hosting
  30. DNS Security Options
  31. FTP Server
  32. Securing the FTP Server
  33. Email Server
  34. Postfix Configuration
  35. Dealing with Identical Users
  36. Configuring Email Clients
  37. Configuring Outlook
  38. Samba Server
  39. Configuring SAMBA Server
  40. The smb.conf File
  41. smb.conf Analysis
  42. Adding Users to Samba

Virtual Web Hosting

Now that you have everything functional, you shouldn't miss this opportunity to serve virtual web sites.

All you have to do:

  1. Edit /etc/httpd/conf/httpd.conf
    Find Section ### Vitual Hosts ###
  2. Find this line:

    Include conf/vhosts/Vhosts.conf

    Make sure it is uncommented. Move to /vhosts directory and tweak Vhosts.conf it will contain all virtual hosting domains.

  3. Edit Vhosts.conf and insert the following information at the bottom of the script:
        ServerPath  /onetraining
        DocumentRoot  /var/www/html/onetraining/

Note. Do this for each additional virtual Domain.

Move to /var/www/html and create the directory onetraining, move some content into it. Follow this convention (use domain names) to create directories for each domain, it makes it much easier to maintain.

Word of Caution

Please note that during the project in this book, I used a Public IP address for demonstration purposes. Make sure you use your own IP addresses for your servers if you are going live online. For practice, I suggest you use a private local IP address. Refer to chapter 9 for types of networks.

You should setup the web server and the DNS server as different identities. So if the DNS sever goes down; the web server can be still reached through a different DNS (slave for example).

Slave DNS Servers

Once your DNS server resolves your zones correctly, you preferably should set up a slave DNS server for security purposes just in case your primary DNS server goes down. You should have this slave DNS as far as possible from your primary server, especially if you are offering services to the public.
A slave DNS is simply a name server that copies zones files from a master. And it is set up as follows:

    Zone	“” {
	    Type slave;
    	File “/var/named/”;
	    Masters {};

The zones are transferred by the SOA (Start of authority record), using the mechanism called zone-transfer, as follows.

$ttl 38400	IN	SOA	root.localhost. (
				1063884851  ;Serial 
				10800            ;Refresh
				3600              ;Retry
				604800          ;Expire
				38400 )          ;Minimum

The zone transfer depends on the serial number. The serial number, in many cases will represent the year + date + hour. The slave will also check on the refresh interval to verify if the master has been updated, if the master has been updated the new information is transferred to the slave DNS to keep the database synchronized.

The verification will depend on the retry time in 3600 seconds (1hr) set as value on the retry option at the SOA of the zone (master server). If the slave DNS fails to contact the master server when it reaches the expired time 604800 seconds and it did not find the master server on each retry; the slave DNS server then removes the zone in its database and will no longer be a slave for that specific zone from the SOA.