Centos panele giriş yaptıktan sonra sol menüdeki apache altında Apache vhost template linkine tıklıyoruz.
Sayfa ortasındaki
<Directory "PATH_REPLACE"> AllowOverride All
kısmını bulup bu satırların altına
<IfModule mod_mime.c> AddType application/x-javascript .js AddType text/css .css </IfModule> <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/plain text/xml application/javascript <IfModule mod_setenvif.c> BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch MSIE !no-gzip !gzip-only-text/html </IfModule> </IfModule> <IfModule mod_expires.c> ExpiresActive on ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" </IfModule>
</Directory> den önce kodlarını yapıştırıyoruz.
Yani yaklaşık şöyle bir görüntü olacak.
<Directory "PATH_REPLACE"> AllowOverride All <IfModule mod_mime.c> AddType application/x-javascript .js AddType text/css .css </IfModule> <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/plain text/xml application/javascript <IfModule mod_setenvif.c> BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch MSIE !no-gzip !gzip-only-text/html </IfModule> </IfModule> <IfModule mod_expires.c> ExpiresActive on ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" </IfModule> </Directory>
yukarıdaki işlemin aynısını eğer kullanıyorsanız apache_ssl içinde yapacaksınız.
Yani kaydedecesiniz.
Bu işlemden sonra gene sol menüden apache başlığı altından Rebuild Virtual Hosts menüsüne tıklayıp siteleri düzenleyin.
Son olarak gene apache menüsünden Apache Configuration’a tıklayarak açılan sayfadan aşağıdaki satırları tek tek bularak
LoadModule mime_module modules/mod_mime.so LoadModule deflate_module modules/mod_deflate.so LoadModule expires_module modules/mod_expires.so
varsa başındaki # işaretini kaldırın. Yani her bir satır yukarıdaki gibi gözükecek.
Son olarak aynı sayfada sayfanın en alt kısmına
# mod_deflate configuration <IfModule mod_deflate.c> # Restrict compression to these MIME types AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/css # Level of compression (Highest 9 - Lowest 1) DeflateCompressionLevel 9 # Netscape 4.x has some problems. BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html </IfModule>
kısmını ekleyin ve apache’yi restart edin.
İşlem bittikten sonra buradan gzip/sıkıştırmanın çalışıp çalışmadığını test edebilirisniz.