安装Nginx
apt install -y nginx
测试PHP语言环境
安装PHP
root@Server01:~# apt -y install php7.4-fpm
测试是否支持PHP语言环境
root@Server01:~# echo "<?php phpinfo();?>" > /var/www/html/info.php
并在Client打开浏览器输入172.16.100.201/info.php验证
配置支持PHP环境
root@Server01:~# vim /etc/nginx/sites-enabled/default
找到location模块
location ~ \.php$ { ----去掉注释
include snippets/fastcgi-php.conf; ---去掉注释
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/run/php/php7.4-fpm.sock; ---去掉注释
# # With php-cgi (or other tcp sockets):
# fa