apt update -y
apt upgrae -y
#安装nginx
apt install -y nginx
#安装php环境
#存储库包含迄今为止的所有发行版本的PHP
add-apt-repository ppa:ondrej/php
apt install php7.4 php7.4-fpm php7.4-gd php7.4-cgi php7.4-mysql php7.4-xml php7.4-mbstring \
php7.4-json php7.4-mcrypt php7.4-common php7.4-dev php7.4-curl -y
#安装mariadb
apt install -y mariadb-server
#设置MySQL root用户密码为root,并开启密码登录
mysql
use mysql;
update user set Password=password('root'),plugin='' where User='root';
flush privileges;
#开放3306端口
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
#把 bind-address 这一行注释掉后重启mysql即可