Web服务有个很有名的词: LAMP(1.Linux 2.Apache 3.Mysql 4.PHP) 比如一个网站的发帖留言功能,在网页提交,PHP将你的留言提交到数据库中,PHP登陆数据库调用你所有的留言,将你的留言产生html语句显示到主页上。 这个对外服务需要确定IP地址和端口号(https 443 http 80)
1.Kali Linux中是包含Apache的,在/etc目录下通过ls可以显示出来,我们只需要进行配置即可。

2.打开Apache服务
/etc/init.d/apache2 start
/etc/init.d/apache2 status
#使用start打开Apache服务,顺便用status查看是否顺利打开
或者是这样也可以
cd /etc/apache2
systemctl restart apache2
systemctl status apache2

如果出现一样的界面那就是安装完成(Kali自带安装好的Apache就是方便)
1.同上Kali虚拟机中也是有包含有MySQL的,在/etc中ls就可以看到。

2.运行php -v可以看到php是配置好的

(注意:如果是7.3版本的mysql要改成mysqli,这里我们是7.4.5)
1.同上Kali虚拟机中有MySQL,在/etc中ls可以看到。

2.打开MySQL服务
cd /etc
systemctl start mysql
systemctl status mysql
或者这种方式也可以:
sudo su
cd /etc
service mysql restart
service mysql status
4.初始化界面之后重启服务,再次输入命令:
systemctl restart mysql
systemctl status mysql