1、安装前更新
sudo apt-get update # 获取最新资源包
sudo apt-get upgrade # 更新全部软件
sudo apt-get dist-upgrade #更新系统软件
2、安装apache
sudo apt install apache2 -y
开启|关闭|重启服务器: /etc/init.d/apache2 start|stop|restart
在浏览器中输入 http://localhost,出现以下画面安装成功
![425523a1-1a64-43a7-b6c3-d1633e6a89b7.png](https://upload-images.jianshu.io/upload_images/9725057-7c3b9061cf964a47.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3、安装mysql
sudo apt install mysql-server mysql-client
4、安装php
sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0