S
S
symbyon12015-12-01 05:30:32
Apache HTTP Server
symbyon1, 2015-12-01 05:30:32

How to install Apache mod_expires?

The crux of the problem!
There is a web server on it, ubuntu server 14.04 and ispmanager are installed and the site is up.
It is necessary to do caching of the site, pierced all the methods that are on the Internet
Everything was worn one by one in htaccess
1.
ExpiresActive On
ExpiresDefault "access plus 11 month"
Header append Cache-Control "public"
2.
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year "
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
3.
Header set Cache-Control "max-age=2592000, public"
Header set Cache -Control "max-age=88000,
private, must-revalidate"
Header set Cache-Control "private, no-store, no-cache,
must-revalidate, no-transform, max-age=0"
Header set Pragma "no -cache"
Result 0 even with the first code, the server gave an error 500, then I tried it through html
and the result is still not the one I need ((((
Who can tell me, I've been racking my brain for more than a day

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
neol, 2015-12-01
@neol

In Ubuntu, mod_expires is supposed to be set by default, but not enabled.
To activate it (and mod_headers, which is needed in two of the three examples you gave), run:

sudo a2enmod expires
sudo a2enmod headers
sudo service apache2 reload

S
symbyon1, 2015-12-02
@symbyon1

[email protected]:/home/symbyon1# sudo a2enmod expires
Module expires already enabled
[email protected]:/home/symbyon1# sudo a2enmod headers
Module headers already
enabled

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question