linux centos7 yum 安装 Apache

  1. 安装
yum install -y httpd
  1. 启动apache
systemctl start httpd.service
  1. 设置Apache开机启动
systemctl enable httpd.service
  1. apache命令相关命令
// 启动apache
systemctl start httpd.service
// 停止apache
systemctl stop httpd.service 
// 重启apache
systemctl restart httpd.service
// 设置apache开机启动
systemctl enable httpd.service

重启后,在浏览器输入域名或IP地址,如果是本机可以输入localhost进行测试。

你可能感兴趣的:(linux centos7 yum 安装 Apache)