Code: Select all
ExpiresActive Directive
Description: Enables generation of Expires headers
Syntax: ExpiresActive On|Off
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Extension
Module: mod_expires
Code: Select all
Example:
# enable expirations
ExpiresActive On
# expire GIF images after a month in the client's cache
ExpiresByType image/gif A2592000
# HTML documents are good for a week from the
# time they were changed
ExpiresByType text/html M604800
Code: Select all
ExpiresActive On
ExpiresByType text/html M1
I remember setting on RCCGNET and it is working perfectly.
I did a comparison on httpd to see if there's anything there. It doesn't even have mod_expires.c compiled in it. However, the configuration of virtual host section shows differences.
Code: Select all
<VirtualHost \
192.168.0.1:80 \
74.208.107.179:80 \
>
ServerName jcsc.rccgcms.net
UseCanonicalName Off
DocumentRoot /var/www/vhosts/default/htdocs/JCSC
ScriptAlias /cgi-bin/ "/var/www/vhosts/default/cgi-bin/"
ErrorLog /var/log/httpd/error_log_jcsc
CustomLog /var/log/httpd/access_log_jcsc combined
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory "/var/www/vhosts/default/cgi-bin/">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/vhosts/default/htdocs/JCSC>
AllowOverride All
Options SymLinksIfOwnerMatch ExecCGI
Order allow,deny
Allow from all
</Directory>
ExpiresActive On
ExpiresByType text/html M1
</VirtualHost>
I then checked httpd onhsiao.net. I found the folloiwing from 'httpd -L' list:
Code: Select all
ExpiresActive (mod_expires.c)
Limited to 'on' or 'off'
Allowed in *.conf anywhere and in .htaccess
when AllowOverride includes Indexes
ExpiresByType (mod_expires.c)
a MIME type followed by an expiry date code
Allowed in *.conf anywhere and in .htaccess
when AllowOverride includes Indexes
ExpiresDefault (mod_expires.c)
an expiry date code
Allowed in *.conf anywhere and in .htaccess
when AllowOverride includes Indexes
I went back to the above mod_expires page and checked again. It does have "Override: Indexes" in it.
I clicked on "Override" link and found:
Code: Select all
Override
This directive attribute indicates which configuration override must be active in order for the directive to be processed when it appears in a .htaccess file. If the directive's context doesn't permit it to appear in .htaccess files, then no context will be listed.
Overrides are activated by the AllowOverride directive, and apply to a particular scope (such as a directory) and all descendants, unless further modified by other AllowOverride directives at lower levels. The documentation for that directive also lists the possible override names available.
Here is the modified config for my virtual host:
Code: Select all
<VirtualHost 192.168.1.225:80>
ServerAdmin cah@hsiao.net
DocumentRoot /export/home/www/html/cah
ServerName chang-an.hsiao.net
ServerAlias cah.hsiao.net
ErrorLog /export/home/cah/logs/error_log_an
CustomLog /export/home/cah/logs/access_log_an combined
HostnameLookups on
<Directory "/export/home/www/html/cah">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
</Directory>
ExpiresActive On
ExpiresByType text/html M1
AddHandler server-parsed .shtml
</VirtualHost>
The pages seem to change now. More testing may be needed to call the conclusion.
After trying more tests, it didn't seem to help.
The page didn't show the latest page until it's manually refreshed...................