Hi, How can I check using IF statements if the module is present before applying the configuration rule or before installing it? Thanks.
<IfMododule .......> .. your stuff ... </IfModule> See http://httpd.apache.org/docs/2.0/mod/core.html#ifmodule
Be careful. Just because a module is loaded, doesn't mean any part of it is actually active. An example of what I mean can be seen with this bit I use to enable support for pre-compressed gzip requests. <IfModule !deflate_module> <IfModule headers_module> <IfModule rewrite_module> <FilesMatch "\.html\.gz$"> Header set Content-Encoding gzip AddType text/html gz </FilesMatch> RewriteEngine On RewriteCond %{HTTP:accept-encoding} gzip RewriteCond %{REQUEST_FILENAME}.gz -f RewriteRule \.html$ %{REQUEST_URI}.gz </IfModule> </IfModule> </IfModule> Code (markup): Because the directives mod_deflate makes available can conflict with my pre-compressed files, essentially double-compressing them, I have to make sure mod_deflate isn't active before I allow the pre-compressed versions to be used. However, !deflate_module only tells me that mod_deflate is not loaded. It could be possible that mod_deflate is loaded, but none of the conflicting confituration options are active, meaning it would be safe for me to comment out the <IfModule !deflate_module> bit.