VPS命令备忘 老鸟请无视

作者:

配置80端口

看了好几个页面内容都有错,下面是正确方法:
#/sbin/iptables -I INPUT -p tcp –dport 80 -j ACCEPT
#/sbin/iptables -I INPUT -p tcp –dport 22 -j ACCEPT

然 后保存:
#/etc/rc.d/init.d/iptables save

再查看是否已经有了:
[root@vcentos ~]# /etc/init.d/iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     udp  —  0.0.0.0/0            0.0.0.0/0           udp dpt:80
2    ACCEPT     tcp  —  0.0.0.0/0            0.0.0.0/0           tcp dpt:80
3    RH-Firewall-1-INPUT  all  —  0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
1    RH-Firewall-1-INPUT  all  —  0.0.0.0/0            0.0.0.0/0

==============================================================

Centos常用配置文件:

(1)/etc/profile ,系统级的环境变量和启动程序配置,修改后对所有用户都有效

(2)/etc/rc.local ,这个脚本将在开机启动的时候,自动运行,可放置一些需要每次开机自启动的程序如tomcat,mysql,oracle

这个在opensuse中 对应的是/etc/init.d/boot.local这个文件

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注