LNMP
LNMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写LNMP==Linux+Nginx+Mysql+PHP的结构体系。
实验环境准备:
机器 | 软件版本 | 系统 |
---|---|---|
nginx | nginx/1.15.0 | Centos7 |
mysql | 8.0.15 MySQL Community Server - GPL | Centos7 |
php | php-7.4.8 | Centos7 |
实验前环境处理
- 同步时间
ntpdate
- 关闭防火墙
[root@lnmp-nginx nginx]# systemctl stop firewalld
[root@lnmp-nginx nginx]# systemctl disable firewalld
#使用sed替换,永久修改,当前不生效
[root@lnmp-nginx nginx]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
[root@lnmp-nginx nginx]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@lnmp-nginx ~]# setenforce 0 #临时生效1打开0关闭
[root@lnmp-nginx ~]# getenforce #查看当前selinux状态
Permissive
实验开始:
配置 /usr/local/php7/etc/php-fpm.conf
(将之前默认文件备份)
[root@father ~]# cd /usr/local/php7/etc/
[root@father etc]# ls
pear.conf php-fpm.conf.default php-fpm.d php.ini
[root@father etc]# cd php-fpm.d/
[root@father php-fpm.d]# ls
www.conf.default
[root@father etc]# cp php-fpm.conf.default php-fpm.conf
[root@father etc]# cd php-fpm.d/
[root@father php-fpm.d]# cp www.conf.default www.conf
[root@lnmp-php etc]