one. Check if installation
1. Static compilation
Bin/apachectl-l|grep mod_expires
MOD_EXPIRES.C
2. Dynamic compilation
grep mod_expires conf/httpd.conf
or
ll/application/apache/modules/|grep Expires
3. Use DSO method to complement the installation
/application/apache/bin/apxs-c-i-a mod_expires.c
Apxs is a tool for installing an extension module for Apache compilation. " --with-apxs2=/application/apache/bin/apxs "; apxs parameter Description:
- C This option indicates the need to perform a compile operation
-I This option indicates the need to perform an installation operation to install one or more dynamic objects into the server's modules directory
- A This option automatically adds a loadmodule line to the httpd.conf file to stimulate this module
two. Add a configuration
1.To Add a configuration code:
expiresactive on
ExpiresDefault "Access plus month"
expiresbytype text/html "Access plus months"
expiresbytype text/css "Access plus months"
expiresbytype image/gif "Access plus months"
expiresbytype image/jpeg "Access plus months"
expiresbytype image/jpg "Access plus months"
expiresbytype image/png "Access plus months"
expiresbytype application/x-shockwave-flash "Access plus months"
expiresbytype application/x-javascript "Access plus months"
expiresbytype video/x-flv "Access plus months"
2.Scope:
a.server config, virtual host, directory,. htaccess
B. Contention on specific directories cache instances set in http.conf
<directory "/data/www/blog/wp-content/" >
expiresbytype image/gif "Access plus months"
expiresbytype image/jpeg "Access plus months"
expiresbytype image/jpg "Access plus months"
expiresbytype image/png "Access plus months"
</Directory>
Adding Mod_expire modules to Apache