CentOS8安装Apache详细过程

yangji 2021-9-16 383 9/16

#使用yum工具安装Apache

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

#使用systemctl start命令启动httpd服务

[root@Centos8 ~]# systemctl start httpd

#使用systemctl status命令查看httpd服务

[root@Centos8 ~]# systemctl status httpd

出现下图所示的active,证明成功了。

CentOS8安装Apache详细过程

#命令systemctl enable可设置某服务为开机自启动。
#命令systemctl disable可设置某服务为开机不自动启动。

[root@Centos8~]# systemctl enable httpd.service

Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service /usr/lib/systemd/system/httpd.service.

#使用systemctl list-unit-files命令确认httpd服务是否已配置为开机自启动

[root@Centos8~]# systemctl list-unit-files | grep httpd.service

如果是failed,查看是否是端口号引起的错误,并进行修改。
强制卸载Apache的方法:rpm -e httpd --nodeps

- THE END -

yangji

9月16日16:38

最后修改:2021年9月16日
0

非特殊说明,本博所有文章均为博主原创。

共有 0 条评论