一、安装memcached
1.安装
yum install memcached
2.设置1G内存
memcached -u memcached -p 11211 -m 1024 -c 1024 -d
3.启动与设置开机自启动
systemctl start memcached
systemctl enable memcached
4.检测是否安装成功
telnet localhost 11211
5.退出
quit
二、安装Redis与phpRedisAdmin
1.安装Redis
yum install redis
2.配置
vim /etc/redis.conf
修改配置文件37行:
daemonize yes
pidfile /data/redis/redis.pid
logfile /data/redis/logs/redis.log
3.启动redis与配置开机自启动
systemctl start redis
systemctl enable redis
4.进入Redis
redis-cli
5.退出
quit
三、安装phpRedisAdmin
1.到 /data/www/目录下 克隆phpRedisAdmin的项目
cd /data/www git clone https://github.com/erikdubbelboer/phpRedisAdmin
2.配置phpRedisAdmin
cd /data/www/phpRedisAdmin/includes/
cp config.sample.inc.php config.inc.php
3.配置phpRedisAdmin的虚拟主机路径
vim /etc/httpd/conf/extra/httpd-vhosts.conf vim /etc/nginx/upstream.conf vim /data/nginx/vhosts/syhuo.net.conf
4.重启nginx和apache
systemctl restart nginx
systemctl restart httpd
5.用php管道下载composer,并且将composer文件夹移动到bin目录
curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer
6.进入phpRedisAdmin文件夹,并安装composer
cd /data/www/phpRedisAdmin/ composer install
配置LANMP环境(10)-- 安装memcached与redis
原文:http://www.cnblogs.com/shifu204/p/6361164.html