Configuring the setup for a web server
Let's say, for example, one of the Raspberry Pis is configured as a web server. So, the task now will be to set up the cluster in such a way that you can type a name in a browser and have the home page of the web server load up!
By convention, web servers are supposed to have static IP addresses. This is so that DNS servers can store their hostnames without worrying too much about IP addresses changing. Since we earlier put in the entire range of IP addresses possible as the range for the DHCP server, we will modify that range so that we can reserve some static IP addresses for our web servers. For this, again edit the /etc/dnsmasq.conf
file and modify the dhcp-range
variable to the following:
dhcp-range=192.168.1.40,192.168.1.254,255.255.255.0,12h
So, now we have non-DHCP IP addresses from 192.168.1.2 to 192.168.1.39, which we can allot to the web servers. One of the ways to do this is to modify /etc/network/interfaces
and /etc/resolve.conf
on the web...