ЩѕШґШЄЫЊШЁШЩЫЊ ШЩЩШЫЊЩ

نحوه نصب Memcached

Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
آموزش نصب
memcache

Make sure before you start tying to install memcache that you have gcc (# yum install gcc) and libevent-devel (# yum install libevent-devel) installed.

    [root@server1 ~]# wget http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz
    [root@server1 ~]# tar -zxvf memcached-1.2.6.tar.gz
    [root@server1 ~]# cd memcached-1.2.6
    [root@server1 memcached-1.2.6]# ./configure
    [root@server1 memcached-1.2.6]# make
    [root@server1 memcached-1.2.6]# make install

    Now if you are lazy like me and don’t want to have to remember what the memcached flags are every time you start it I would recommend using an init.d script. I recommend using the one located at http://www.dev411.com/wiki/Memcached_startup_files_for_Red_Hat_(RHEL). To install the init.d script on your server you need to place the start-memcached perl script in /usr/local/bin/start-memcached. Make sure you have given this file chmod 755 and is chown root:root. Then you must place the memcached-init into /etc/init.d/memcached, make sure this script has the same permissions as the previous file. Finally create the configuration file /etc/memcached.conf, you can place any options that you want ran by the memcached binary in this file. I use the following in my file.

    # /etc/memcached.conf

    # user to run memcached as
    -u apache

    # we want to run memcached as a daemon
    -d

    # amount of RAM we want to dedicate to memcached in MB
    -m 512

    # interface to listen to for memcached connections on
    -l 127.0.0.1

    # port to listen for memcached connections on
    -p 11211

    Starting Memcached

    Now you should be able to start and stop memcached quickly by using the following commands.

    [root@server1 ~]# /sbin/service memcached start
    [root@server1 ~]# /sbin/service memcached stop

    If you did not install the init.d script then you can start memcached with the following command.

    [root@server1 ~]# memcached -d -u apache -m 512 -l 127.0.0.1 -p 11211

    Installing the Memcache PHP extension

    Installing the memcache php module from source is fairly strait forward, it is just like installing any other php module. Please note that you must have zlib-devel and php-devel packages installed.


    [root@server1 ~]# wget http://pecl.php.net/get/memcache
    [root@server1 ~]# tar -zxvf memcache-3.0.2.tgz
    [root@server1 ~]# cd memcache-3.0.2
    [root@server1 memcache-3.0.2]# phpize
    [root@server1 memcache-3.0.2]# ./configure
    [root@server1 memcache-3.0.2]# make
    [root@server1 memcache-3.0.2]# make install


    Now we need to tell php to include our memcache extension when it starts up. We do this by putting the following configuration data in /etc/php.d/memcache.ini

    ; /etc/php.d/memcache.ini

    ; include the memcache php extension
    extension=memcache.so

    You will be able to verify that the memcache php extension has been installed by typing # php -m and looking for memcache in the php extension list.


  • 26 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

دستورات SSH

برای اتصال به سرور خود و برای برقراری ارتباط از راه دور شما نیاز به یک ssh client در کامپیوتر...

آموزش و نصب اسکریپت مخصوص آپاچی Deflate DDOs

بسیاری از دوستان که از آپاچی مجبور هستن استفاده کنن و در مقابل حملات ddos ضعیف عمل میکند بهترین...

آموزش جلوگیری از حملات دی داس (dDos)

  در این مقاله قصد داریم آموزش نحوه جلوگیری از حملات دی داس (dDos) به صورت دستی و بلاک نمودن آی...

نحوه تغییر پسورد root ssh

به دو طریق می توان پسورد روت را تغییر داد   راه اول از طریق whm Change Root Password Steps 1...

نحوه نصب Rootkits Hunter یا Rkhunter

  Rkhunter یکی از ابزار مفید جهت شناسایی و از بین بردن انواع trojans, rootkits و ترمیم مشکلات...