部署了應用,但是修改apache默認是80端口,又不想用80端口,於是就改其他端口,結果彈出:Permission denied: make_sock: could not bind to address [::]:XX,哥用的是root啊,不應該有權限問題,查了一下才知道是開了selinux保護。
解決這樣的問題有兩個方法:
1.就是停掉selinux,最直接最根本的解決方法,但是會缺少保護
echo 0 > /etc/selinux/enforce
2.我用的centos,現在安裝工具吧
# yum install policycoreutils-python
# semanage port -l | grep http
查看一下selinux下面允許http作爲端口信息
http_cache_port_t tcp 3128, 8080, 8118, 10001-10010
http_cache_port_t udp 3130
http_port_t tcp 80, 443, 488, 8008, 8009, 8443
pegasus_http_port_t tcp 5988
pegasus_https_port_t tcp 5989
# semanage port -a -t http_port_t -p tcp 78
把端口78 加進去
# semanage port -l | grep http
http_cache_port_t tcp 3128, 8080, 8118, 10001-10010
http_cache_port_t udp 3130
http_port_t tcp 78, 80, 443, 488, 8008, 8009, 8443
pegasus_http_port_t tcp 5988
pegasus_https_port_t tcp 5989
再重啓一下:# /etc/init.d/httpd restart
ok了。。