For this demonstration, we will be working with the httpd.conf file from an Apache 2.4 HTTPD server taken from a CentOS 7.x host. To be perfectly honest, we are far more interested in the configuration file, as Red Hat or CentOS supply it, than the actual configuration changes that we will make. The file will be available for download from the code bundle of the chapter. Our purpose is to learn how we can extract data from the system-supplied file and create a template from it. We can apply this to Apache configuration files or any other text data file. It is the methodology we are looking at, not the actual result.
To have some understanding of what we are trying to do, we must first look at the /etc/httpd/conf/httpd.conf file, that is, CentOS, Red Hat Enterprise Linux, or Scientific Linux. The following screenshot shows the virtual host section...