For the demonstration, we will be working with the httpd.conf
file from an Apache 2.2 HTTPD Server taken from a CentOS 6.6 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. 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 not looking at 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 shipped with Enterprise Linux 6, that is, CentOS, Red Hat Enterprise Linux, or Scientific Linux. The following screenshot shows the virtual host section of the file that we are interested in:
Looking at these lines, we can see that they are commented and this is all a part of a monolithic httpd.conf
. While...