httpd监听其他端口启动报错

想建立一个测试用的虚拟主机,遇到了这个问题:
[[email protected] html]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.termwikidev for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:81
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:81
no listening sockets available, shutting down
Unable to open logs

解决办法:

semanage port -l|grep http
semanage port -a -t http_port_t -p tcp 81

这个两个命令一是查看,一个是添加,添加完再查看一遍,如果有81,则成功。另可能要以root用户运行。

 

如果semanage命令不存在

bash: semanage: command not found

安装  policycoreutils-python-2.0.83-19.39.el6.x86_64.rpm 

涉及到的包有

httpd监听其他端口启动报错