Adding Mod_expire modules to Apache

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.