安装redis
- 使用home-brew一键安装:brew install redis
- 启动Redis服务:brew services start redis 或 redis-server /usr/local/etc/redis.conf
- 关闭Redis服务:brew services stop redis
- 重启Redis服务:brew services restart redis
- 进入redis:redis-cli
测试redis, 键入
set test hello
再输入get test
可以出现hello就说明测试成功
查看redis内存并关闭
ps -ef | grep -i redis
kill -9 pid
至于端口号修改,我们一般不对redis端口号进行修改, 默认为6379, 如果要修改的话就去 /usr/local/etc/redis.conf 修改

安装Nginx
brew install nginx
运行
nginx
然后打开修改端口, 因为8080一般都会被占用
open /usr/local/etc/nginx/nginx.conf

修改完成后, reload就好了
nginx -s reload
终端可能没有什么反应, 在浏览器地址输入localhost:8181
要是跳出来nginx就说明安装成功
网友评论