centos7下环境配置

时间:2023-03-09 20:17:03
centos7下环境配置

1:  安装memcached

  问题:error: libevent is required. If it's already installed, specify its path using –with-libevent=/dir/

  安装memcached的configure过程遇到这个问题,但是查看是否已经安装了libevent,你会发现系统已经安装了;但还是报错,这是由于libevent是系统默认安装的,并没有安装相应的开发所用的头文件,因此还要用yum -y install libevent-devel;

  参考链接:http://www.wp31.com/1022.html

---------------------------------------- 转载自 http://www.wp31.com/1022.html ----------------------------------------

查看系统是否已经安装libevent

# rpm -qa|grep libevent

如果有,不要高兴,先升级

#yum -y install libevent

测试libevent是不是已经安装成功

#ls -al /usr/lib | grep libevent

可以看到多个已经安装的类包安装memcached(http://memcached.org/)
可以先查看编译参数

# wget http://memcached.googlecode.com/files/memcached-1.4.8.tar.gz
# tar zxvf memcached-1.4.8.tar.gz
# cd memcached-1.4.8
# ./configure –help
# ./configure –prefix=/usr/local/memcached
# make
# make install

在这个时候,不一定会编译通过,依旧会出现:

checking for libevent directory… configure: error: libevent is required. You can get it from http://www.monkey.org/~provos/libevent/
If it’s already installed, specify its path using –with-libevent=/dir/

因为libevent 这个包是系统默认安装的,没有安装相应的开发所用的头文件。
所以,还要使用如下命令来安装:

yum install libevent-devel

再编辑,即可通过。。
启用Memcached,
/usr/local/memcached/bin/memcached -d -m 128 -l 192.168.1.1 -p 11211 -u root
============================================

memcached 启动报error while loading shared libraries: libevent-1.4.s解决办法:

原因是找不到libevent-1.4.so.2类库,解决办法如下:

使用LD_DEBUG=help ./memcached -v来确定 加载的类库路径,方法如下:

ln -s /usr/local/lib/libevent-1.4.so.2 /lib/libevent-1.4.so.2

貌似用ldconfig也能解决问题

---------------------------------------- 转载自 http://www.wp31.com/1022.html ----------------------------------------

2:redis安装

redis make error:  You need tcl 8.5 or newer in order to run the Redis test

参考链接:

  http://blog.csdn.net/luyee2010/article/details/18766911

-------------------------------引用自:http://blog.csdn.net/luyee2010/article/details/18766911------------------------

wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
sudo tar xzvf tcl8.6.1-src.tar.gz -C /usr/local/
cd /usr/local/tcl8.6.1/unix/
sudo ./configure
sudo make
sudo make install

-------------------------------引用自:http://blog.csdn.net/luyee2010/article/details/18766911------------------------