该问题是由SELinux 引起的.(注本人的环境为centos 6.0)
解决办法有两个:
1.快速解决(不推荐)
2.从根上解决(推荐)
根据自己的需求在selinux中添加需要指定的端口
a)前提需要先安装semanage(Centos6.0默认没有安装该应用)
安装方式参看 RHEL 6: semanage SELinux Command Not Found
也可以参看http://wiki.centos.org/HowTos/SELinux
# yum provides /usr/sbin/semanage or #yum whatprovides /usr/sbin/semanage #yum -y install policycoreutils-python #semanage
b)使用semanage添加apache侦听的端口
参看http://hi.baidu.com/5212521/blog/item/0b998b1bdb15c7018618bf8c.html或http://hi.baidu.com/ldtrain/blog/item/59c9bb1e242247fee0fe0b5b.html
查看现在的支持http的端口有哪些
#semanage port -l|grep http
为http服务添加新的端81
#semanage port -a -t http_port_t -p tcp 81
查看添加的结果
#semanage port -l|grep http