I once had to deal with such a file, each time the company bought out another company they added their brands into the 1 BIG httpd.conf file, different brands had to be tested in different test environments. Our approach was:
- Start with a new empty file and include only things that needed to be included. Keep it in a version control system if you have one.
- Use include directive. This lets you enable disable entire brands.
- Use a Template system to create virtual hosts, like below, with over a dozen brands. running accross 5 or 6 environments
- Use a spreadsheet created by the business to create the virtual hosts files. This worked well with the perl excel parser module. In the end the business analysts could just change the spreadsheet and get a new set of virtual hosts for inclusion and the admins were happy because they could disable/enable enviroments by commenting/enabling a single line in httpd.conf.
grep out all the comment lines and blank lines. It seems less daunting when you reduce a 5000 line file to 2000 by removing all the spacing and comments.
# Begin Virtual Host: [% brand_description %]
Listen [% dyn_ip %]:[% dyn_port %]
<VirtualHost [% dyn_ip %]:[% dyn_port %]>
ServerAdmin [% server_admin %]
ServerName [% dyn_ip %]:[% dyn_port %]
DocumentRoot "[% document_root %]"
<Directory />
DirectoryIndex index.html
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
ErrorLog [% error_log %]
CustomLog [% custom_log %] combined
JKMount [% jk_mount_point %] [% jk_balancer_name %]
ErrorDocument 502 /holding/50x_disruption-page.html
ErrorDocument 503 /holding/50x_disruption-page.html
RedirectPermanent [% payment_page %] [% brand_payment_url %]
</VirtualHost>
# End Virtual Host: [% brand_description %]