LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1540|回复: 2

请问在fc5上如何用非root用户启动80端口,或者将80端口映射到其他端口?

[复制链接]
发表于 2006-5-8 02:31:42 | 显示全部楼层 |阅读模式
目的是启动tomcat的web服务,然后供其他用户访问.
如果能将80端口转到8080上也行.
我试过用iptables来设置转发,但是失败了,也没看到有什么错误提示.
另外,是不是一定要打开防火墙,才能用iptables设置?
发表于 2006-5-8 08:44:03 | 显示全部楼层
  1.    REDIRECT
  2.        This  target is only valid in the nat table, in the PREROUTING and OUT-
  3.        PUT chains, and user-defined chains which are only  called  from  those
  4.        chains.   It redirects the packet to the machine itself by changing the
  5.        destination IP  to  the  primary  address  of  the  incoming  interface
  6.        (locally-generated  packets  are  mapped to the 127.0.0.1 address).  It
  7.        takes one option:
  8.        --to-ports port[-port]
  9.               This specifies a destination port or  range  of  ports  to  use:
  10.               without  this,  the  destination port is never altered.  This is
  11.               only valid if the rule also specifies -p tcp or -p udp.
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-5-8 16:26:40 | 显示全部楼层
谢谢,我是用这句解决的
iptables -t nat -I OUTPUT --src 0/0 --dst 192.168.1.100 -p tcp --dport 80 -j REDIRECT --to-ports 8080
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表