CentOS – PHP MemCACHE Nasıl Kurulur? How to install?

Gelişmiş cache/önbellekleme  sistemlerinden olan MemCACHE kurulumu CentOS sunucular için nasıl yapılır? Gelin en pratik yoluna bir bakalım:

PHP MemCACHE Nasıl Kurulur?
How to install PHP MemCACHE?

 

  • # yum install memcached.x86_64 php-pecl-memcache.x86_64

    OR 
  •  # yum install memcached php-pecl-memcache 
  • Örnek çıktı:Sample outputs:Loaded plugins: fastestmirror, security
    Setting up Install Process
    Loading mirror speeds from cached hostfile
    * atomic: mirror1.34sp.com
    * base: mirror-fr1.bbln.org
    * extras: mirror-fr1.bbln.org
    * updates: centos.crazyfrogs.org
    Resolving Dependencies
    –> Running transaction check
    —> Package memcached.x86_64 0:1.4.22-4.el6.art will be installed
    —> Package php-pecl-memcache.x86_64 0:3.0.8-3.el6.art will be installed
    –> Finished Dependency ResolutionDependencies Resolved

    =================================================================================
    Package                 Arch         Version                 Repository    Size
    =================================================================================
    Installing:
    memcached               x86_64       1.4.22-4.el6.art        atomic        85 k
    php-pecl-memcache       x86_64       3.0.8-3.el6.art         atomic        83 k

    Transaction Summary
    =================================================================================
    Install       2 Package(s)

    Total download size: 168 k
    Installed size: 465 k
    Is this ok [y/N]: y
    Downloading Packages:
    (1/2): memcached-1.4.22-4.el6.art.x86_64.rpm              |  85 kB     00:00
    (2/2): php-pecl-memcache-3.0.8-3.el6.art.x86_64.rpm       |  83 kB     00:00
    ———————————————————————————
    Total                                            1.1 MB/s | 168 kB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Installing : php-pecl-memcache-3.0.8-3.el6.art.x86_64                      1/2
    Installing : memcached-1.4.22-4.el6.art.x86_64                             2/2
    Verifying  : memcached-1.4.22-4.el6.art.x86_64                             1/2
    Verifying  : php-pecl-memcache-3.0.8-3.el6.art.x86_64                      2/2

    Installed:
    memcached.x86_64 0:1.4.22-4.el6.art php-pecl-memcache.x86_64 0:3.0.8-3.el6.art

    Complete!

  • # vi /etc/sysconfig/memcachededit the memcache config
    Manuel olarak SFTP programları ile ya da vi ile konfigürasyon dosyasını düzenleyelim:
  • default config outputs
    PORT=”11211″
    USER=”memcached”
    MAXCONN=”1024″
    CACHESIZE=”64″
    OPTIONS=””we recommend, replacePORT=”11211″
    USER=”memcached”
    MAXCONN=”3024″
    CACHESIZE=”564″
    OPTIONS=”” 
  • MemCACHE nasıl yönetilir?
    How to manage MemCACHE ?
    # /etc/init.d/memcached start
    # /etc/init.d/memcached stop
    # /etc/init.d/memcached restart
    # /etc/init.d/memcached status 
  • MemCACHE şu an çalışıyor mu?
    If it is running or not? Type the following command to see
    # pgrep memcached
    # netstat -tulpn | grep :11211 
  • MemCACHE ile sunucunun genel istatiklerini görmek için:
    To get general stats about the server: use the memcache# memcached-tool 192.168.1.15:11211 stats


    Source/Kaynak: http://www.cyberciti.biz/faq/howto-install-memcached-under-rhel-fedora-centos/