Centos7 安装Apache架设网站

前言:

学习Linux的笔记。懒得解释了~~~

正文:

一、安装apache

1-1、安装

yum -y install httpd

1-2、控制apache的一些常用命令:

systemctl stop httpd
systemctl start httpd
systemctl restart httpd
systemctl status httpd

Tip:停止、开启、重启、状态,几种命令。

1-3、防火墙放行并重启防火墙:

firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --permanent --zone=public --add-port=443/tcp
systemctl restart firewalld

1-4、默认站点根目录为:/var/www/html

结尾:

原创文章