Linux下开启apache 8790端口问题解决

服务器环境 CentOS 6.3 Final


1、安装Apach httpd

yum install httpd.x86_64

2、修改apach 端口为8790

vi /etc/httpd/conf/httpd.conf

修改

listen 80 为 listen 8790

3、启动httpd服务

命令执行 service httpd start 报错如下:

[root@SVR01 ~]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:8790
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:8790
no listening sockets available, shutting down
Unable to open logs
                                                           [FAILED]

查找原因:参见http://blog.chinaunix.net/uid-7208369-id-2658461.html


执行semanage port -l | grep http查看 SETLinux管理的http端口时,报错如下:

[root@SVR01 ~]# semanage port -l | grep http
-bash: semanage: command not found

没有semanage命令

查找semanage命令的包,执行命令yum provides /usr/sbin/semanage

[root@SVR01 ~]# yum provides /usr/sbin/semanage
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirrors.btte.net
 * extras: mirrors.btte.net
 * updates: mirrors.btte.net
policycoreutils-python-2.0.83-19.24.el6.x86_64 : SELinux policy core python utilities
Repo        : base
Matched from:
Filename    : /usr/sbin/semanage

得知为policycoreutils-python-2.0.83-19.24.el6.x86_64

安装policycoreutils-python-2.0.83-19.24.el6.x86_64

[root@SVR01 ~]# yum -y install policycoreutils-python

设置SETLinux管理http的端口

semanage port -a -t http_port_t -p tcp 8790

启动httpd服务,正常OK!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值