我正面临着清理一个不合理的Apacheconfiguration的问题。 它积累了近十年的土地。 我正在重构它,修复tab / indentation,把部分分解成包含。
你有任何有用的脚本/技术/ bbeditconfiguration文件或关于保持有组织的Apacheconfiguration的一般build议? 有没有关于正确组织Apacheconfiguration的书籍/网站?
我曾经不得不处理这样一个文件,每当公司收购了另外一家公司,他们把品牌join到1GB的httpd.conf文件中,不同的品牌就必须在不同的testing环境中进行testing。 我们的做法是:
grep所有注释行和空白行。 通过删除所有间距和注释,将5000行文件减less到2000时,似乎不那么令人生畏。 # 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 %]