본문 바로가기

프로그래밍언어/리눅스

리눅스 firewalld 설치 // firewall-cmd: command not found 에러

서버 세팅 도중 

 firewall-cmd: command not found 

에러가 발생



리눅스에서 가장 많이 사용되는

OS중 하나인 Centos 7에

서 방화벽 관련 포트나

서비스를 열거나 닫을 때, 

firewalld명령어를 사용하는데,

 최소설치를 했을 때에는 

자동으로 설치 되지 않기 때문에

 firewalld 명령어를 사용 할 경우

 firewall-cmd: command not found라는

 오류 메시지가 발생.

 이 오류 메시지는 간단하게

설치만 해주면 해결이되는데,

 yum을 통해서 설치.



[root@xorms0707 ~]# yum install firewalld


설치완료 후 시스템에 등록하고 작동되도록 실행


[root@xorms0707 ~]# systemctl unmask firewalld
[root@xorms0707 ~]# systemctl enable firewalld
[root@xorms0707 ~]# systemctl start firewalld




방화벽 설정


http,https접속 가능하게 포트를 열고, 다시로드

 [root@xorms0707 ~]# firewall-cmd --permanent --add-service=http
[root@xorms0707 ~]# firewall-cmd --permanent --add-service=https
[root@xorms0707 ~]# firewall-cmd --reload



IP로 접속하여 다음처럼나올 시 Apache 설치완료