php7 RPM 安装

https://webtatic.com

CentOS/RHEL 7.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS/RHEL 6.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

安装php

Now you can install PHP 7.1’s mod_php SAPI (along with an opcode cache) by doing:

yum install mod_php71w php71w-opcache

You can alternatively install PHP 7.1’s php-fpm SAPI (along with an opcode cache by doing:

yum install -y php71w-fpm php71w-opcache

yum install php71w-*

 systemctl start php-fpm

其他:
安装rpm包时遇到Header V3 DSA signature: NOKEY时解决办法
导入rpg
rpm --import /etc/pki/rpm-gpg/RPM*

redis 安装

redis 官网 http://redis.io

===安装===
yum -y install gcc gcc-c++ libstdc++-devel
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar -zxvf redis-5.0.5.tar.gz
cd redis-5.0.5
make
===运行===
cp /data/src/redis-5.0.5/redis.conf /etc/redis/
vim /etc/redis/redis.conf
;开启
deamonize on

redis-server /etc/redis/redis.conf

===开机自启动===
echo "redis-server /etc/redis/redis.conf" >>/etc/rc.local
===设置密码(需要重启redis才能生效)===
CONFIG get requirepass
CONFIG set requirepass “****”
设置后访问
redis-cli -h 127.0.0.1 -p 6379 -a ****
===关闭===
redis-cli shutdown
===修改 Redis 服务运行账号===
useradd -M -s /sbin/nologin [username]

===安全参考===
https://help.aliyun.com/knowledge_detail/37447.html