Linux CentOS7 yum安装Apache

# yum install -y httpd

启动apache

# systemctl start httpd.service

设置Apache开机启动

# systemctl enable httpd.service

apache命令相关命令

// 启动apache
# systemctl start httpd.service
// 停止apache
# systemctl stop httpd.service 
// 重启apache
# systemctl restart httpd.service
// 设置apache开机启动
# systemctl enable httpd.service

重启后,在浏览器输入域名或IP地址,如果是本机可以输入localhost进行测试。
注意:如果你防火墙没有开放80端口的话,是无法访问的,所以你要去看我另一篇文章:
Linux CentOS7 设置防火墙使apache及mysql可以被外部访问

猜你喜欢

转载自blog.csdn.net/weikaixxxxxx/article/details/83444829