0
点赞
收藏
分享

微信扫一扫

Redis入门基础命令

非衣所思 2023-07-24 阅读 56

文章目录

一、环境说明

主机服务
192.168.161.129nginx
192.168.161.131mysql
192.168.161.132php

二、安装nginx

1.参考文章,nginx部署。
在这里插入图片描述

三、安装mysql

1.参考文章,mysql二进制部署。
在这里插入图片描述

四、安装php

1.参考文章,php编译安装

在这里插入图片描述

五、配置nginx

1.nginx配置文件指定php服务器地址,指定php服务器上的网页文件。

http {
    server {
        listen       80;
        server_name  www.qingjun.com;
        location / {
            root   html;
            index   index.php index.html index.htm;    //添加php文件。
        }
        location ~ \.php$ {
            root           /opt;     //寻找/opt目录下.php结尾的文件。
            fastcgi_pass   192.168.161.132:9000;    //指定php服务器ip。
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /$Document_Root$fastcgi_script_name;
            include        fastcgi_params;
        }

    }
}

2.生成前端文件。

cat > /usr/local/nginx/html/index.php << EOF
<?php
   phpinfo();
?>
EOF

3.重启nginx。

nginx -s stop
nginx

六、配置php

1.php服务器上指定前端文件,需要与nginx配置文件里指定位置保持一致。这里就是/opt/index.php文件。

cat > /opt/index.php << EOF
<?php
   phpinfo();
?>
EOF

七、验证

1.访问nginx的IP,查看显示结果。

在这里插入图片描述

举报

相关推荐

0 条评论