在linux上配置apache2的步骤比较简单,可以直接通过apt-get install命令就可以了
sudo apt-get install apache2
安装完毕后我们可以通过whereis apache2来查看apache2的位置
安装完毕后启动apache2:sudo apache2ctl -k start
关闭apache2:sudo apache2ctl -k stop
重启apache2:sudo apache2ctl -k restart
启动apache2服务器之后我们可以通过访问http://localhost/,若出现 It works即证明成功启动apache2.