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,最好自己指定目录,便于管理

相关内容