为了方便快捷搭建linux环境,有这几篇CentOS使用yum安装jdkCentOS安装tomcatCentOS安装NginxCentOS安装MySqlCentos安装Redis1。安装Nginx前请先确认是否安装了gccg++开发类库。yum-yinstallgccautomakeautoconflibtoolmake(安装make)yuminstallgccgcc-c++(安装g++)2.下载Rediscd/usr/local/wgethttp://download.redis.io/releases/redis-4.0.14.tar.gz3.安装Redistarxzfredis-4.0.14.tar.gzcdredis-4.0.14makemakeinstall4。修改Redis配置文件viredis.confrequirepass123456(修改密码)port8888(修改端口号)daemonizeyes(后台启动)protected-modeno(远程访问配置bind127.0.0.1改为bind0.0.0.0(远程accessconfiguration)maxmemory8GB(内存配置)maxmemory-policyvolatile-ttl(内存淘汰策略)(*noeviction:当内存使用量达到设置的阈值时,所有导致内存申请的命令都会报错。??allkeys-lru:In主键空间,先移除最近未使用的keyvolatile-lru:在设置了过期时间的key空间,先移除最近未使用的keyusedkeyallkeys-random:在主键空间,随机移除一个key.volatile-random:在设置了过期时间的key空间中,随机移除一个key.volatile-ttl:当设置了过期时间的keyspace中,先移除过期时间早的key。*)5.startrediscd/usr/local/binredis-server(正常启动)redis-server&(命令版后台启动)redis-server../redis-4.0.14/redis.conf(指定配置文件启动)7.Stopredis(./redis-cli-h127.0.0.1-p8888-a123456然后关机)ps-ef|grepredis(查看redis进程)kill-9pid(kill进程)
