Control Web Panel
WebPanel => Apache => Topic started by: airodump on April 19, 2016, 01:07:27 AM
-
Hi all, this is my first time use centos web panel i want ask something regarding mod_expires, how i can enable it ? thanks before.
im already try this tips http://forum.centos-webpanel.com/informations/activating-gzip-mod_deflate-and-enabling-caching-on-apache/
but my site on gtmetrix still show expires header and leverage, im already check if my .httaccess is fine. so after i read and try to find it maybe its related with mod_expires. thanks before.
-
add this lines to htaccess and remove any previous lines for deflate and leverage
## EXPIRES CACHING ##
<IfModule mod_expires.c>
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 "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 1 month"
</IfModule>
## EXPIRES CACHING ##
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>
-
thanks but my .httacces already like that. its 8 files and also get note expiration not specified.
-
if you want better suggestion please post your home page url
-
here the url for test with gtmetrix
https://gtmetrix.com/reports/www.duniasantri.co/rZEEyg2w
-
did you tried to installed nginx as a reverse proxy? Nginx will increase the scores.
-
ok thank you i will try now.
-
im try nginx as reverse proxy, but still fail. but its solve now, just go to rebuild apache and choose apache 2.2.31 after that click next and dont forget put --enable-expires
--enable-headers
--enable-proxy
in additional configuration then start compiler and waiting. if done rebuild your vhost and nginx. and solved my headcaches about leverage browser caching and expires header.
-
My server is Apache & Varnish Cache & Nginx Reverse Proxy ([Varnish Conf])
HTTP: Nginx (80) --> Varnish (82) --> Apache (8181)
HTTPS: Nginx (443) --> Varnish (82) --> Apache (8181)
My host only have opened port 80 and 443. 82 and 8181 are closed, i dont get any error, but cant cache point never pass any site test. (i already have mod_expires on htaccess)
Should need opened port 82 and 8181?
Thanks
-
no, you only need to have open ports 80 and 443, for testing you can open others and then close once you are done with the testing.
Try to change if you have issues and then return back.