Linux源碼安裝memcached,linux源碼memcached
基本步驟:
1、下載壓縮檔(wget 檔案url)
2、解壓(tar -zxvf 檔案名稱)
3、configure (./configure --prefix=安裝目錄)
4、make編譯 (前提是步驟3沒問題,否則轉步驟1)
5、make install 安裝 (安裝完後記得cd到安裝目錄查看相應檔案是否產生)
6、清除安裝過程中產生的臨時檔案和設定檔 (make clean & make distclean)
以下是安裝過程中用到的所有命令
[root@localhost ~]# mkdir test
[root@localhost ~]# cd test
[root@localhost test]# wget http://www.memcached.org/files/memcached-1.4.24.tar.gz
[root@localhost test]# tar -zxvf memcached-1.4.24.tar.gz
[root@localhost test]# mkdir memcached
[root@localhost test]# mkdir libevent
[root@localhost test]# wget https://github.com/downloads/libevent/libevent/libevent-1.4.14b-stable.tar.gz
[root@localhost test]# tar -zxvf libevent-1.4.14b-stable.tar.gz
[root@localhost test]# cd libevent-1.4.14b-stable
[root@localhostlibevent-1.4.14b-stable]# ./configure --prefix=/root/test/libevent
[root@localhost libevent-1.4.14b-stable]# make
[root@localhost libevent-1.4.14b-stable]# make install
[root@localhost libevent-1.4.14b-stable]# cd ../memcached-1.4.24
[root@localhost memcached-1.4.24]# ./configure --prefix=/root/test/memcached --with-libevent=/root/test/libevent
[root@localhost memcached-1.4.24]# make
[root@localhost memcached-1.4.24]# make install
[root@localhost memcached-1.4.24]# cd ../memcached
[root@localhost memcached]# ll
到此可見memcached目錄下的檔案,即安裝成功,注意安裝memcached之前需要libevent,兩者版本要一致,我建立了一個臨時的目錄用於測試,實際安裝過程中可能指定目錄為/root/local/memcached,最好自己指定目錄,便於管理
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。