切换到root帐号,安装软件包源: apt-get install software-properties-common
1、安装PHP7.1
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.1-cli php7.1-fpm php7.1-common php7.1-curl php7.1-xml php7.1-gd php7.1-mysql php7.1-mbstring php7.1-bcmath php7.1-dev php7.1-zip
相关服务命令:
service php7.1-fpm start/stop/restart
2、安装Nginx
add-apt-repository ppa:ondrej/nginx
apt-get update
apt-get install nginx-full
配置站点php-fpm
vim /etc/nginx/sites-available/default
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
相关服务命令:
service nginx start/stop/restart
3、安装Mysql5.7
add-apt-repository ppa:ondrej/mysql
apt-get update
apt-get install mysql-server-5.7
配置远程链接
创建远程链接帐号
mysql -u root -h localhost -p
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘remote_root‘@’%’ IDENTIFIED BY ‘123456‘ WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
修改cnf配置
vim /etc/mysql/mysql.conf.d/mysqld.cnf
将bind-address = 127.0.0.1
设置成bind-address = 0.0.0.0(设备地址)
重启mysql
service mysql restart