Kali配置LNMP环境并搭建pikachu环境
版本:
Nginx:1.8
Mysql:10.5
PHP/fpm:7.4
安装Nginx
└─
nginx:
Installed: 1.18.0-6.1
Candidate: 1.18.0-6.1
Version table:
*** 1.18.0-6.1 500
500 http://mirrors.aliyun.com/kali kali-rolling/main amd64 Packages
100 /var/lib/dpkg/status
└─
补充说明
Nginx 网站目录是 /var/www/html
将项目代码放在这个文件夹下(类似apache/htdocs)
Nginx 网站配置文件位置是 /etc/nginx/sites-available/default
启动Nginx服务
安装PHP7.4和PHP扩展
└─
php:
Installed: 2:7.4+76
Candidate: 2:7.4+76
Version table:
*** 2:7.4+76 500
500 http://mirrors.aliyun.com/kali kali-rolling/main amd64 Packages
100 /var/lib/dpkg/status
php-fpm:
Installed: (none)
Candidate: 2:7.4+76
Version table:
2:7.4+76 500
500 http://mirrors.aliyun.com/kali kali-rolling/main amd64 Packages
└─
PHP 7.4.21 (cli) (built: Sep 24 2021 22:49:49) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.21, Copyright (c), by Zend Technologies
配置Nginx和PHP-FPM
PHP-FPM 与 Nginx 通信方式有两种:
一种是基于TCP的 Internet domain socket 方式,一种是 UNIX domain socket 方式。
UNIX domain socket 可以使同一台操作系统上的两个或多个进程进行数据通信。 UNIX domain socket 的接口和 Internet domain socket 很像,但它不使用网络底层协议来通信。
服务器压力不大的情况下,这两种方式性能差别不大,但在压力比较满的时候,用UNIX domain socket方式,效果确实比较好。
location ~