安装Apache2
sudo apt-get update
sudo apt-get install apache2
安装成功后在 /etc/apache2 目录下可以看见它的配置文件:
在 /var/www/html 目录下可以看到 index.html 文件,只需要启动Apache2服务,就可以使用同一局域网下的的设备通过ip地址访问到此页面。
Apache2 的命令
启动 Apache2 服务
sudo /etc/init.d/apache2 start
关闭 Apache2 服务
sudo /etc/init.d/apache2 stop
重启 Apache2 服务
sudo /etc/init.d/apache2 restart
输入ifconfig查看本机的 ip 地址: