centos7 搭建httpd服务

  • 查看是否有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服务

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值