在apache中绑定非http标准端口时,一直出现如下的错误提示:

[root@localhost ~]# /etc/init.d/httpd start
Starting httpd: (13)Permission denied: make_sock: could not bind to
address 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 httpd
start
Stopping httpd: [ OK  ]

Starting httpd: [  OK  ]

CentOS下安装semanage

安装:

# yum -y install policycoreutils-python

semanage使用方法:

/usr/sbin/semanage:

semanage [ -S store ] -i [ input_file | - ]

semanage [ -S store ] -o [ output_file | - ]

semanage {boolean|login|user|port|interface|module|node|fcontext} -{l|D|E} [-n]

semanage login -{a|d|m} [-sr] login_name | %groupname

semanage user -{a|d|m} [-LrRP] selinux_name

semanage port -{a|d|m} [-tr] [ -p proto ] port | port_range

semanage interface -{a|d|m} [-tr] interface_spec

semanage module -{a|d|m} [--enable|--disable] module

semanage node -{a|d|m} [-tr] [ -p protocol ] [-M netmask] addr

semanage fcontext -{a|d|m} [-efrst] file_spec

semanage boolean -{d|m} [--on|--off|-1|-0] -F boolean | boolean_file

semanage permissive -{d|a|l} type

semanage dontaudit [ on | off ]

Primary Options:

-a, --add        Add a OBJECT record NAME

-d, --delete     Delete a OBJECT record NAME

-m, --modify     Modify a OBJECT record NAME

-i, --input      Input multiple semange commands in a transaction

-o, --output     Output current customizations as semange commands

-l, --list       List the OBJECTS

-E, --extract    extract customizable commands

-C, --locallist  List OBJECTS local customizations

-D, --deleteall  Remove all OBJECTS local customizations

-h, --help       Display this message

-n, --noheading  Do not print heading when listing OBJECTS

-S, --store      Select and alternate SELinux store to manage

Object-specific Options (see above):

-f, --ftype      File Type of OBJECT

"" (all files)

-- (regular file)

-d (directory)

-c (character device)

-b (block device)

-s (socket)

-l (symbolic link)

-p (named pipe)

-F, --file       Treat target as an input file for command, change multiple settings

-p, --proto      Port protocol (tcp or udp) or internet protocol version of node (ipv4 or ipv6)

-M, --mask       Netmask

-e, --equal      Substitue source path for dest path when labeling

-P, --prefix     Prefix for home directory labeling

-L, --level      Default SELinux Level (MLS/MCS Systems only)

-R, --roles      SELinux Roles (ex: "sysadm_r staff_r")

-s, --seuser     SELinux User Name

-t, --type       SELinux Type for the object

-r, --range      MLS/MCS Security Range (MLS/MCS Systems only)

--enable         Enable a module

--disable        Disable a module

最新文章

  1. 如何:加载分页结果(WCF 数据服务)
  2. win7 x64 vs2010 directShow开发环境配置
  3. Nexus3.0.0+Maven的使用(一)
  4. HMC破解控制台密码
  5. ThinkPHP之数据库操作
  6. [Socket网络编程]由于套接字没有连接并且(当使用一个 sendto 调用发送数据报套接字时)没有提供地址,发送或接收数据的请求没有被接受。
  7. js严格模式“use strict”
  8. Tomcat执行流程
  9. P121 6.7 第一题和第二题
  10. python学习笔记27(python中sys模块的使用)
  11. C++的类和对象
  12. pygame实现的黑白块游戏
  13. javaCV开发详解之5:录制音频(录制麦克风)到本地文件/流媒体服务器(基于javax.sound、javaCV-FFMPEG)
  14. sqlserver常用存储过程基本语法
  15. 【C语言基础】循环体系
  16. linux配置PS1
  17. Java多线程系列——从菜鸟到入门
  18. python tkinter-单选、多选
  19. Python全栈-网络编程-TCP粘包
  20. underscore-1.8.3-analysis.js

热门文章

  1. Http请求之基于HttpUrlConnection,支持Header,Body传值,支持Multipart上传文件:
  2. FitLayout
  3. DevExpress RichEditControl 上下翻页功能 z
  4. dwz navtab 限制打开数量实例
  5. 北京市基本医疗保险A类定点医疗机构名单(2010-09-29)
  6. [Android Pro] Android源码编译之Nexus5真机编译
  7. R语言缺点
  8. 【BZOJ】【3170】【TJOI2103】松鼠聚会
  9. Java文件操作大全
  10. perfect-rectangle