- 查看是否有httpd
[root@Cheney ~]# yum list httpd
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.huaweicloud.com
* epel: mirrors.neusoft.edu.cn
* extras: mirrors.huaweicloud.com
* updates: mirrors.huaweicloud.com
可安装的软件包
httpd.x86_64
- 安装httpd
yum install -y httpd.x86_64
- 查看服务是否启动
systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:httpd(8)
man:apachectl(8)
- 启动httpd
systemctl start httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since 日 2019-11-24 12:58:19 CST; 2s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 14846 (httpd)
Status: "Processing requests..."
CGroup: /system.slice/httpd.service
├─14846 /usr/sbin/httpd -DFOREGROUND
├─15342 /usr/sbin/httpd -DFOREGROUND
├─15343 /usr/sbin/httpd -DFOREGROUND
├─15344 /usr/sbin/httpd -DFOREGROUND
├─15345 /usr/sbin/httpd -DFOREGROUND
├─15346 /usr/sbin/httpd -DFOREGROUND
├─15389 /usr/sbin/httpd -DFOREGROUND
├─15390 /usr/sbin/httpd -DFOREGROUND
└─15391 /usr/sbin/httpd -DFOREGROUND
11月 24 12:57:59 centos systemd[1]: Starting The Apache HTTP Server...
11月 24 12:58:09 centos httpd[14846]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:fe9e:6622. Set the 'ServerName' directive globally to suppress this message
11月 24 12:58:19 centos systemd[1]: Started The Apache HTTP Server.
- 设置为开机自启
systemctl enable httpd
- 访问安装httpd的服务器
例如我这里是 192.168.1.10
推荐文章:
centos7搭建httpd服务