文章目录
一、搭建LNMP
环境准备:
1.关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
vim /etc/selinux/config
SELINUX=disabled
setenforce 0
2.安装nginx/mariadb-server/php/php-mysql/php-fpm/php-gd
yum install nginx mariadb-server php php-mysql php-gd php-fpm -y
3.配置LNMP环境
1)数据库:
1、支持中文
vim /etc/my.cnf
[mysqld]
character-set-server=utf8
2、初始安全设置
mysql_secure_installation
Enter current password for root (enter for none): 回车键
Set root password? [Y/n] y
设置密码(123456)
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
2)nginx支持php:
[root@manager ~]# vim /etc/php-fpm.d/www.conf
user = nginx
group = nginx
[root@manager html]# cat /etc/nginx