My system is running Red Hat Ent 3 and Plesk (7.5.1).
My system is configured so that the main httpd.conf is in /etc/httpd/conf
The main httpd.conf also includes files for each site, for example if you have a site called mysite.com it will include:
/home/httpd/vhosts/mysite.com/conf/httpd.include
However, the comments in the httpd.include files make it very clear that you should not modify that file with this comment:
CODE
# ATTENTION!
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
# /home/httpd/vhosts/mysite.com/conf/vhost.conf
# /home/httpd/vhosts/mysite.com/conf/vhost_ssl.conf
# /home/httpd/vhosts/mysite.com/subdomains/<subdomain-name>/conf/vhost.conf
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
# /home/httpd/vhosts/mysite.com/conf/vhost.conf
# /home/httpd/vhosts/mysite.com/conf/vhost_ssl.conf
# /home/httpd/vhosts/mysite.com/subdomains/<subdomain-name>/conf/vhost.conf
So, as it says I created a file called vhost.conf and put the following in it:
CODE
# Enable and set default cache rule
ExpiresActive On
ExpiresDefault "access plus 0 minutes"
# images
ExpiresByType image/gif "modification plus 10 years"
ExpiresByType image/png "modification plus 10 years"
ExpiresByType image/jpeg "modification plus 10 years"
# html and text (Don't cache)
ExpiresByType text/html "access plus 0 minutes"
ExpiresByType text/plain "access plus 0 minutes"
# other types (Short cache)
ExpiresByType text/css "access plus 1 days"
ExpiresByType application/x-javascript "access plus 1 days"
ExpiresActive On
ExpiresDefault "access plus 0 minutes"
# images
ExpiresByType image/gif "modification plus 10 years"
ExpiresByType image/png "modification plus 10 years"
ExpiresByType image/jpeg "modification plus 10 years"
# html and text (Don't cache)
ExpiresByType text/html "access plus 0 minutes"
ExpiresByType text/plain "access plus 0 minutes"
# other types (Short cache)
ExpiresByType text/css "access plus 1 days"
ExpiresByType application/x-javascript "access plus 1 days"
I restarted apache and cleared my browsers cache and then visited my site, but the headers show that no expiration details are being sent.
Heres an example header:
CODE
(Status-Line) HTTP/1.1 200 OK
Accept-Ranges bytes
Connection close
Content-Length 10448
Content-Type image/png
Date Wed, 06 Apr 2005 11:23:05 GMT
ETag "c0500a-28d0-30661480"
Last-Modified Fri, 02 Jan 2004 23:18:26 GMT
Server Apache/2.0.46 (Red Hat)
Accept-Ranges bytes
Connection close
Content-Length 10448
Content-Type image/png
Date Wed, 06 Apr 2005 11:23:05 GMT
ETag "c0500a-28d0-30661480"
Last-Modified Fri, 02 Jan 2004 23:18:26 GMT
Server Apache/2.0.46 (Red Hat)
Any ideas?
Theres nothing in my main errors.log.
My main httpd.conf contains the following line,so it should be ok:
LoadModule expires_module modules/mod_expires.so
Any help would be appreciated.
Thanks
Ben