加入收藏 | 设为首页 | 会员中心 | 我要投稿 聊城站长网 (https://www.0635zz.com/)- 智能语音交互、行业智能、AI应用、云计算、5G!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

redis环境下mysql是如何实现lnmp框架缓存的

发布时间:2023-09-27 15:21:04 所属栏目:MySql教程 来源:
导读:本文主要给大家介绍redis环境下mysql是如何实现lnmp架构缓存的,文章内容都是笔者用心摘选和编辑的,具有一定的针对性,对大家的参考意义还是比较大的,下面跟笔者一起了解下redis环境下mysql是如何实现lnmp架构缓存
本文主要给大家介绍redis环境下mysql是如何实现lnmp架构缓存的,文章内容都是笔者用心摘选和编辑的,具有一定的针对性,对大家的参考意义还是比较大的,下面跟笔者一起了解下redis环境下mysql是如何实现lnmp架构缓存的吧。
 
配置环境:centos 7.2
 
server1:redis(172.25.254.1)
 
server2:php(172.25.254.2)
 
server3:mysql(172.25.254.3)
 
配置步骤:
 
server2:
 
1、server2安装php的redis相应模块
 
redis环境下mysql是如何实现lnmp架构缓存的
 
2、nginx安装

[root@server2 php-fpm.d]# rpm -ivh nginx-1.8.0-1.el6.ngx.x86_64.rpm
 
warning: nginx-1.8.0-1.el6.ngx.x86_64.rpm: header v4 rsa/sha1 signature, key id 7bd9bf62: nokey
 
preparing...        ########################################### [100%]
 
  1:nginx         ########################################### [100%]
 
 thanks for using nginx!

please find the official documentation for nginx here:
 
* https://nginx.org/en/docs/
 
commercial subscriptions for nginx are available on:
 
* https://nginx.com/products/

[root@server2 php-fpm.d]# id nginx
 
uid=498(nginx) gid=499(nginx) groups=499(nginx)
 
3、nginx和php配置
 
1、php配置

[root@server2 php-fpm.d]# cd /etc/php-fpm.d/
 
[root@server2 php-fpm.d]# id nginx
 
uid=498(nginx) gid=499(nginx) groups=499(nginx)
 
[root@server2 php-fpm.d]# vim www.conf
 
 39 user = nginx
 
 41 group = nginx
 
 [root@server2 php-fpm.d]# vim /etc/php.ini
 
 946 date.timezone = asia/shanghai
 
[root@server2 php-fpm.d]# /etc/init.d/php-fpm start
 
starting php-fpm:                     [ ok ]
 
[root@server2 php-fpm.d]# netstat -antlp | grep php
 
tcp    0   0 127.0.0.1:9000       0.0.0.0:*          listen   1125/php-fpm   
 
[root@server2 php-fpm.d]# vim /etc/php.ini
 
2、nginx配置

[root@server2 ~]# cd /etc/nginx/conf.d/
 
[root@server2 conf.d]# ls
 
default.conf example_ssl.conf
 
[root@server2 conf.d]# vim default.conf
 
 10     index index.php index.html index.htm;
 
 30   location ~ \.php$ {
 
 31     root      html;
 
 32     fastcgi_pass  127.0.0.1:9000;
 
 33     fastcgi_index index.php;
 
 34     fastcgi_param script_filename /usr/share/nginx/html$fastcgi_script  _name;
 
 35     include    fastcgi_params;
 
 36   }
 
[root@server2 conf.d]# nginx -t
 
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
 
nginx: configuration file /etc/nginx/nginx.conf test is successful
 
[root@server2 conf.d]# nginx
 
[root@server2 conf.d]# netstat -anplt |grep nginx
 
tcp    0   0 0.0.0.0:80         0.0.0.0:*          listen   1141/nginx
 
 

(编辑:聊城站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章