系统版本
系统镜像:CentOS-7-x86_64-Minimal-1708
安装服务
[root@localhost ~]# yum install -y httpd
服务开机自启动
[root@localhost ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
启动 httpd 服务
[root@localhost ~]# systemctl start httpd
查看状态
[root@localhost ~]# systemctl status httpd
浏览器查看效果
输入虚拟机地址:
(查看虚拟机ip: [root@localhost ~]# ip addr )
创建目录
[root@localhost ~]# mkdir /var/www/html/test
浏览器录入地址:
至此,Centos7 安装 httpd 服务 操作完毕!