Warning

If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

Apache keša serveris

Information

Apache keša serveris saglabā dinamiski veidotu HTML lapu statiskas kopijas, tādējādi būtiski paātrinot lapas sagatavošanu uz servera un atgriešanu pārlūkprogrammai.

Uzstādīšana

  1. Izpilda komandu:

    sudo a2enmod cache_disk
  2. root lietotājs papildina failu /etc/apache2/mods-enabled/cache_disk.conf ar, piemēram, sekojošām rindām:

    <ifmodule mod_disk_cache.c>
    CacheEnable disk /
    CacheDirLevels 2
    CacheDirLength 1
    CacheMaxFileSize 10000000
    CacheMinFileSize 1
    CacheLastModifiedFactor 0.1
    CacheDefaultExpire 3600
    CacheMaxExpire 86400
    </ifmodule>
  3. Ja nepieciešams, norāda adreses, kuras nevajag kešot, piemēram:

    # Disable caching for registering and editing on Xwiki
    CacheDisable /xwiki/bin/admin/
    CacheDisable /xwiki/bin/edit/
    CacheDisable /xwiki/bin/imagecaptcha/
    CacheDisable /xwiki/bin/inline/
    CacheDisable /xwiki/bin/login/
    CacheDisable /xwiki/bin/logout/
    CacheDisable /xwiki/bin/register/
    CacheDisable /xwiki/bin/save/
    CacheDisable /xwiki/bin/view/XWiki/
    CacheDisable /XWiki/
  4. Ja nepieciešams, lai aizsargātu Tomcat lietojumu serveri, samazina maksimālo procesu skaitu:

    ...
    <ifmodule mpm_prefork_module>
    ...
        MaxClients            50
    ...
    </ifmodule>
    ...
  5. Pārstartē serveri:

    /etc/init.d/apache2 restart

    pārliecinās, ka parādās rinda :

     * Restarting web server htcacheclean

Veiktspējas pārbaude

  1. Ar ab (Apache benchmark):

    ab -n 50000 -c 5 http://hostname.lv/GaraLapa
  2. Ar httperf:

    httperf --client=0/1 --server=hostname.lv --port=80 --uri=/Mape/GaraLapa --rate=10 --send-buffer=4096 --recv-buffer=16384 --num-conns=500 --num-calls=1

Zināmās kļūdas

  1. Piesakoties Xwiki un rediģējot saturu, pārlūkprogramma jāpiespiež tiešā veidā pieprasīt atjaunot lapas saturu, spiežot Shift+Enter taustiņus.

Saites


 
 
Tags Serveris Tīmeklis
Created by Valdis Vītoliņš on 2009-04-25 06:27
Last modified by Valdis Vītoliņš on 2025-05-10 17:44
XWiki Powered
Creative Commons Attribution 3.0 Unported License