Apache2 Web 服务器

 

 

Apache2 Web 服务器的安装

sudo apt install apache2 -y

当安装Apache2包之后,Apache2相关的服务是启用的,并在重启后自动运行。在某些情况下如果你的Apache2服务器没有自动运行和启用,可以输入以下命令来启动它。

sudo systemctl start apache2.service

sudo systemctl enable apache2.service

sudo systemctl status apache2.service

如果开启了防火墙(ufw),可以使用下面的命令来解除Web服务器的端口(80和443)限制。

sudo ufw status

sudo ufw allow in 'Apache Full'

可以访问Web服务器

把website文件copy到/var/www/html/,網站就算成功啦!

输入服务器IP地址或主机名(http://IP_Address_OR_Host_Name)

posted @ 2017-02-28 10:37  k98091518  阅读(303)  评论(0编辑  收藏  举报