Apache的安装与启动

发布时间 2023-04-11 17:37:30作者: w328

1.Apache的安装

Linux系统中一般采用Apache作为Web服务器软件,安装软件包为httpd。

可以通过以下命令查询系统是否已安装了Apache软件包。

  [root@localhost~]#yum list installed|grep httpd

如果没有安装httpd软件包,则配好yum源,使用yum命令安装。

  [root@localhost~]#yum install -y httpd

2.Apache的启动

1)启动httpd服务,其命令如下。

  [root@localhost~]#systemctl start httpd

2)设置httpd服务开机自启动,其命令如下。

  [root@localhost~]#systemctl status httpd