얕고넓은지식/linux

Apache(CentOS) 명령어

쪽마 2021. 3. 22. 02:34
반응형

Note:
CentOS7(RHEL7)부터 기존에 사용하던 service 명령이 실행되지 않을 수 있습니다. systemctl 명령어를 사용해주세요.

  • systemctl: /usr/bin/systemctl
  • service: /sbin/service

명령어 종류systemctl (CentOS7)service (CentOS6)

아파치 상태 확인 systemctl status httpd service httpd status
아파치 시작 systemctl start httpd service httpd start
아파치 정지 systemctl stop httpd service httpd stop
아파치 재시작 systemctl restart httpd service httpd restart
아파치 리로드 systemctl reload httpd service httpd reload
아파치 자동시작 설정(On) systemctl enable httpd chkconfig httpd on
아파치 자동시작 해제(Off) systemctl disable httpd chkconfig httpd off
아파치 자동시작 확인 systemctl is-enabled httpd chkconfig httpd
자동 실행 서비스 목록 systemctl list-unit-files --type=service chkconfig --list httpd
아파치 마스크 systemctl mask http
아파치 언마스크 systemctl unmask http
방화벽 시작 systemctl start firewalld service iptables start
방화벽 중지 systemctl stop firewalld service iptables stop
방화벽 자동시작 적용 systemctl enable firewalld chkconfig iptables off
방화벽 자동시작 해제 systemctl disable firewalld chkconfig iptables on
반응형