日期:2014-05-16  浏览次数:20704 次

linux转apache为非80端口
linux下,1024以下的端口只有root权限用户才能用,这导致一个普通用户无法启动80端口的apache,修改iptables配置可达到目的,例如我的apache端口是8888
vi /etc/sysconfig/iptables

*nat
:PREROUTING ACCEPT [520:36561]
:POSTROUTING ACCEPT [961:78067]
:OUTPUT ACCEPT [960:78007]
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8888
-A PREROUTING -d 127.0.0.1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8888
-A OUTPUT -d 127.0.0.1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8888
COMMIT