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

Apache Web server

For all of those who have asked me how a web server works and how to install one, here is your answer… To set up a web server, you don't need a lot of money, if you can afford a DSL connection; with at least 1 static IP then you are in business.
Requirements for the web server

  • DSL connection with Static IP address
  • Linux Operating System
  • Apache web server
  • Pentium MMX +

If you are planning to set up a live web server, make sure you get a static IP Address from your Internet service provider. Also for a live web server you need to register a domain name, something like ( Be aware that some companies charge up to $35.00 and others $10.00 or $15.00 for the same domain name. Shop around before you register your domain.

Note. When setting up a big network it is quite often referred to running a DNS (Domain name Server) however it is not required to run a single web sever because your internet service provider will help you with that; I mean it is your right to request this service that's why you are paying for it.

Let's get started by assigning an IP address to the system. In this example I will use a /29 network; this is a subnet mask of For more information on networks read chapter 8.

Note. When you acquire your Internet connection, your ISP will assign you a subnet mask that will limit your number of hosts according to the package in your contract.
The example in this book will be exactly the same as what you will configure with your IP addresses, all you have to do is just substitute the IP addresses.

Typical static configuration

Let's assume your account includes 5 static IPS. Then your router will actually be configured as follows:
Look at the table below, this is the information sent to you by your ISP.

Router IP168.34.26.56 First available IP168.34.26.58
Gateway IP168.34.26.57Second available IP168.34.26.59
Subnet mask255.255.255.248Third available IP168.34.26.60
First ISP's DNS209.244.0.3Fourth available IP168.34.26.61
Second ISP's DNS200.244.0.4Fifth available IP168.34.26.62
Subnet mask255.255.255.248
Table 9.1

Following table 9.1, we are going to configure our computer:

  • From the console or graphical, Start: linuxconf (if you logged on as regular user, the root password will be requested)
  • On the run command type:
Run Command KDesktop
Fig 9.1
  • Enter the password and hit Enter
  • Once the linuxconf control panel opens, from the Config tab click on Networking
  • From the Client task tab click on: Host name and IP network Devices
Host Name and IP Devices
Fig 9.2

Look at figure 9.2. This is what we need. If you are ready and have your domain name, this is where you will use it. If you don't have a domain name yet but you need to practice these configurations, use anything like, etc.

Host name: The host name is the actual name of the computer and can be called whatever you want such as computerx, serverx or yourname, etc.

Domain: This is the registered domain name, such as:

The next tabs from figure 9.3 are the adaptors 1,2,3,4. This means that in a single machine you can add up to four NICs (Network Interface Cards).

Click on Adaptor 1 to set the configurations.
Observe Figure 9.3 this is the first adapter and it is directly connected to the Internet.

Referring to table 10.1, since the router is using and, my first available-useable IP is:; I will assign this to my first computer (first host).

My first host in this network will be a web server in a domain called

Host Name and IP Devices
Fig 9.3

Please note carefully, what is selected in this picture.

- The adaptor must be set as enabled. If you fail to observe this, the network card will not be active even if you have the correct settings.

     -  The config mode must be Manual because it is a static IP.
     -  You can use DHCP only when you are setting up a workstation and the IP assignation is being done through the DHCP server (Dynamic Host Configuration Protocol)

     -  The BootP, is similar as the DHCP at boot time an IP address is assigned to the NIC (Network Interface Card)

Primary name + domain: you already know this; it is the name of the computer + the registered domain name.

Aliases: These are the other names, how you want the computer to be known, usually the primary name.

IP Address: The physical IP address assigned to the host (this is the address in which the web server will be identified on the internet)

Netmask: This is the subnet mask, which will control how many hosts will be on the network.

Net Device: This is the physical interface card:

      Eth0 = 1 (First Ethernet Adapter)
      Eth1 = 2 (Second Ethernet Adapter)
      Eth2 = 3 (Third Ethernet Adapter)
      Eth3 = 4 (Fourth Ethernet Adapter)

Kernel Module: This is the driver that will make the Net card work. (If the driver is incorrect, the net card will not work).

Mandrake Control Center
Fig 9.4

Note on this picture how easy it is to identify a driver for almost any device.

Some devices allow you to run the configuration wizard here. Whenever possible try to use the manual configuration. I am sure when you learn how to do it; everything will be very simple.

IO Port: Usually, under Linux you don't need to specify an IO/address for the net card as it's handled automatically by the system. In case you are having conflicts with other hardware, read chapter 7 installing hardware for troubleshooting.

IRQ: Same as the IO port, you do not need to specify an Interrupt Request; it is automatically allocated by the system. But if you are having a conflict with another device, you may need to play with it until you find an available IRQ.

Using the same process in configuring the eth0 you can configure other net cards in the system.

Note. Each configured net card is considered as different identity, in other words different networks.

- Once all settings are entered, click on Accept.

In this stage, we are setting up a Web Server alone, and it is dependent to the ISP's DNS server.

Next, from the Client task click on: Name Server Specification (DNS)
Here you enter the DNS IP Address, provided by your Internet Service Provider. Again refer to table 9.1

Resolver Configuration
Fig 9.5

The DNS provided here allows your workstation to query your ISP's server to locate the nearest route to get to the web pages you requested.

The search domain is same as the default domain. These names are not a requirement; however if you enter it, the search domain takes precedence over the default domain. Be aware that this will create more traffic within the workstation and the DNS server.

  • Click on Accept to save the changes.

Note. This is a client configuration known as resolver; do not confuse this with the DNS server. We will set up a DNS later in this book.

The next step is setting the routing

From the client task click on Routing and Gateway

Click on Defaults

Fig 9.6

Refer to table 9.1 and enter your corresponding gateway IP address. Remember the gateway IP is part of the router and is also part of the IP block given to you by your ISP.

  • Make sure this routing option is enabled and Click on Accept.
  • Click on Dismiss
  • Click on Dismiss
  • Click on Quit
  • Click on Do it

Restart your system…
Re-logon, to test your net card; from the console ping the IP Address:

[agustin@server2 agustin]$ ping

Fig 9.7

Look at the picture, if the response from the ping command looks similar; everything is fine. To terminate the ping command, press Ctrl + C. You should be able to browse the Internet now. If you received an unreachable message from the ping command, that means that either the net card is not enabled or the driver being used is incorrect. Refer to figure 9.3.

If that doesn't help, read chapter 2 for configuring the router and configuring the network properties. Assuming that your Internet connection is working now, we will proceed with the Web server configuration.