apache報Permission denied: make_sock: could not bind to address 解決方案

在apache中綁定非http標準端口時,一直出現以下的錯誤提示:
[root@localhost ~]# /etc/init.d/httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind toaddress 0.0.0.0:888
no listening sockets available, shutting down
Unable to open logs
[FAILED]
解決方案一:
增長selinux中http的端口
semanage port -l|grep http #查看SELinux下http相關端口
semanage port -a -t http_port_t -p tcp 888 #增長這個非標準端口便可
[root@localhost ~]# /etc/init.d/httpd restart 或者 service httpdstartpython

semanage這個工具默承認能沒有裝,須要先安裝一下。linux

可使用以下命令查看這個工具在那個package裏:apache

# yum provides /usr/sbin/semanage
socket

ortcp

# yum whatprovides /usr/sbin/semanageide

輸出:工具

Loaded plugins: rhnplugin
rest

policycoreutils-python-2.0.83-19.8.el6_0.x86_64 : SELinux policy core python utilities Repo        : rhel-x86_64-server-6
code

Matched from:
server

Filename    : /usr/sbin/semanage policycoreutils-python-2.0.83-19.1.el6.x86_64 : SELinux policy core python utilities

Repo        : rhel-x86_64-server-6

Matched from:

Filename    : /usr/sbin/semanage


# yum -y install policycoreutils-python


解決方案二:

直接把selinux關掉。

selinux有3個膜式:

Enforcing:強制模式

Permissive:警告模式

Disabled:關閉模式


查看SELinux命令:getenforce
關閉SELinux命令:setenforce 0 #警告模式

關閉SELinux命令:setenforce 1 #強制模式

相關文章
相關標籤/搜索