부팅 후 자동 실행 스 크 립 트 추가
1016 단어 linux
\ # 포트 오픈 nginx http 서 비 스 를 배치 하기 위해 80 포트 개발:
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --sport 80 -j ACCEPT
service iptables save
설명: 상기 실행 에 실패 하면 The service command supports only basic LSB actions (start, stop, restart, try - restart, reload, force - reload, status) 를 표시 합 니 다. For other actions, please try to use systemctl. iptables 서비스 가 설치 되 어 있 지 않 기 때 문 입 니 다.해결: yum install iptables - services
\ # 스 크 립 트 자동 실행 step: 1 위 명령 을 openport. sh 파일 중.예 를 들 어 / home / user / temp / openport.sh
step: 2 실행 명령 을 파일 / etc / rc. d / rc. local 에 기록 합 니 다. 즉, rc. local 파일 마지막 에 추가 합 니 다.
sh /home/user/temp/open_port.sh
step 3: / etc / rc. d / rc. local 파일 에 실행 가능 한 권한 추가:
chmod +x /etc/rc.d/rc.local
이후 다시 켜 면 openport. sh 스 크 립 트 가 자동 으로 실 행 됩 니 다.
참고 글: Centos 7 의 service iptables save 명령 사용 실패 한 결말 방안https://blog.csdn.net/yelllowcong/article/details/78229862
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
용감한 바로 가기 및 우분투 응용 프로그램안녕하세요 여러분, 이 기사에서는 모든 사이트에서 pwa를 생성하고 실행기 응용 프로그램으로 추가하는 방법을 설명하고 싶습니다. 일부 웹사이트는 PWA로 설치를 허용하지 않지만 유사한 애플리케이션을 원합니다. 1. ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.