1、安装PHP相关包
yum install php-cli php-fpm php-gd php-mysqlnd php-mbstring php-opcache php-pdo
2、配置PHP-FPM
启动:
systemctl start php-fpm
3、Nginx安装及配置:
yum install nginx // 安装
systemctl start nginx // 启动
vim /etc/nginx/nginx.conf
修改:
user www;
server_tokens off ;#//关闭nginx版本显示
启动nginx :systemctl start nginx
4、MySQL8安装
yum install mysql mysql-server //安装MySQL8及对应工具
systemctl start mysqld //启动MySQL服务
mysql_secure_installation //初始化(密码例如:Mysql8@1)
5、访问网站,访问数据库
Mysql常用命令及操作命令:MySQL 安装 | 菜鸟教程 (runoob.com)
6、检查防火墙状态
systemctl status firewalld
systemctl stop firewalld 关闭防火墙
可远程访问网站:
可远程连接数据库root:
1、连接服务器: mysql -u root -p
2、看当前所有数据库:show databases;
3、进入mysql数据库:use mysql;
4、查看mysql数据库中所有的表:show tables;
5、查看user表中的数据:select Host, User from user;
6、修改user表中的Host:update user set Host='%' where User='root';
7、最后刷新一下:flush privileges;