我面临着清理一个不合理的大Apache配置的麻烦。它已经积累了将近十年的残渣。我从重构它开始,修复选项卡/缩进,将部分分解为包含。
您是否有任何有用的脚本/技术/ bbedit配置文件或关于保持有组织的apache配置的一般建议?是否有专注于正确组织Apache吐露的书籍/网站?
发布于 2010-01-11 18:52:09
我曾经不得不处理这样的文件,每次公司收购另一家公司时,他们把自己的品牌添加到1大httpd.conf文件中,不同的品牌必须在不同的测试环境中进行测试。我们的做法是:
grep删除所有注释行和空行。通过删除所有的空格和注释,将5000行文件减少到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 %]https://serverfault.com/questions/101605
复制相似问题