OS/Linux

포트 열기/닫기 & 백그라운드 실행

Dev. Tool 2015. 11. 24. 20:46

포트 열기/닫기 -


[root@localhost ~]# vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A INPUT -p tcp or udp --dport 3306 -j DROP

[root@localhost ~]# netstat -tnlp (목록 확인)

[root@localhost ~]# vi /etc/sysconfig/iptables (확인)

[root@localhost ~]# /etc/init.d/iptables save

[root@localhost ~]# /etc/init.d/iptables restart



백그라운드 실행 (node.js 기준) -


[root@localhost ~]# cd /usr/share/node

node index.js &

[1] 2215 (백그라운드 프로세스에 등록 된 pid or 파일은 꼭 755 이상의 퍼미션이 필요)

[root@localhost ~]# ps -ef (백그라운드 목록 확인)

[root@localhost ~]# kill -2215 (백그라운드 사용 하지 않을때)