Bash
ip addr show
Bash
systemctl start httpd.service #起動
systemctl stop httpd.service #停止
systemctl restart httpd.service #再起動
systemctl status httpd.service #ステータスの確認
Bash
[root@localhost ~]# httpd-v
Server version: Apache/2.4.6 (CentOS)
Server built: Aug 4 2017 03:19:10
[root@localhost ~]#
servicesにhttpが書いてないとhttp通信ができない。
以下のコマンド結果は書いてあるのでOK。
Bash
[root@localhost ~]# firewall-cmd--list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh dhcpv6-client http
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@localhost ~]#
Bash
firewall-cmd--permanent--add-service=http
Bash
firewall-cmd--reload