centos nginx 多端口配置过程记录

1. 编辑 /usr/local/nginx/vhosts/  在此目录下增加一文件,如;ci.ainux.com,或复制一个文件 修改其中的端口和目录,更改log_format 名称

    重启nginx:/usr/local/nginx/sbin/nginx -s reload

2. 注意防火墙:增加其它开通的端口;

   编辑/etc/sysconfig/iptables文件。我们实例中要打开8080端口和9990端口   保存后重启;service iptables restart;

   最后再查看下;service iptables status;

CentOS 配置防火墙操作实例(启、停、开、闭端口):

注:防火墙的基本操作命令:

查询防火墙状态:

[root@localhost ~]# service   iptables status<回车>

停止防火墙:

[root@localhost ~]# service   iptables stop <回车>

启动防火墙:

[root@localhost ~]# service   iptables start <回车>

重启防火墙:

[root@localhost ~]# service   iptables restart <回车>

永久关闭防火墙:

[root@localhost ~]# chkconfig   iptables off<回车>

永久关闭后启用:

[root@localhost ~]# chkconfig   iptables on<回车>


原文地址:https://www.cnblogs.com/hubing/p/4451078.html