Help - Search - Members - Calendar
Full Version: Problems using mod_expires on my Plesk machine
The Planet Forums > Control Panels > Plesk
BenS1
I'm trying to configure the mod_expires options for one of my websites.

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


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"


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)


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
DeadEye686
You need to run
CODE
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=yourdomain.com

and then restart httpd in order for Plesk to begin reading from the vhost.conf.
BenS1
Thats great thanks, I'll give it a go.

Out of interest, where is that documented?

Thanks again
Ben
BenS1
I've tried it and sure enough it works!

Thanks you VERY much!

Thanks
Ben
Gentle Giant
Or you can just run

websrvmng -a -v

Does the same thing icon_smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.