一、删除apache的相关包及配置
    sudo apt-get autoremove apache*
二、删除关联
    sudo find /etc -name "*apache*" |xargs  rm -rf
三、清除dept列表
    sudo apt purge `dpkg -l | grep apache| awk '{print $2}' |tr "\n" " "`

一、删除php的相关包及配置
    sudo apt-get autoremove php7*
二、删除关联
    sudo find /etc -name "*php*" |xargs  rm -rf
三、清除dept列表
    sudo apt purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`


apt install apache2 -y
vi /etc/apache2/ports.conf   可以修改端口

sudo apt install php libapache2-mod-php  //apache 关联php
sudo systemctl restart apache2
sudo a2enmod rewrite  //apache2 rewrite

vi /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80> 里添加

     <Directory /var/www/html>
       Options Indexes FollowSymLinks
       AllowOverride All
       Require all granted
     </Directory>

apt install php -y
apt install php-gd
apt install php-mysqli
apt install php-mbstring
