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>
This article is from "Spider-Man" blog, please be sure to keep this source http://txidc.blog.51cto.com/9138217/1566047
Apache Cache module Expires settings