[root@LENOVO-LA0X1 conf]# semanage -h ERROR: policydb version 31 does not match my version range 15-30 ERROR: Unable to open policy //etc/selinux/targeted/policy/policy.31. Traceback (most recent call last): File "/usr/sbin/semanage", line 32, in <module> import seobject File "/usr/lib/python2.7/site-packages/seobject/__init__.py", line 36, in <module> import sepolicy File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 907, in <module> raise e ValueError: 讀取 //etc/selinux/targeted/policy/policy.31 策略文件失敗
使用centos 7.3 修改apachect端口爲88時,發現沒法重啓。python
網上查文章說是SELinux對端口限制,須要去配置端口號。使用semanage來對端口號進行管理,可是semanage一直沒法使用,執行如上。如下給出方法:linux
[root@LENOVO-LA0X1 conf]# yum provides semanage Failed to set locale, defaulting to C ??????fastestmirror, langpacks Loading mirror speeds from cached hostfile policycoreutils-python-2.5-29.el7.x86_64 : SELinux policy core python utilities ? ?base ????? ??? ?/usr/sbin/semanage policycoreutils-python-2.5-29.el7_6.1.x86_64 : SELinux policy core python utilities ? ?updates ????? ??? ?/usr/sbin/semanage policycoreutils-python-2.5-8.el7.x86_64 : SELinux policy core python utilities ? ?@anaconda ????? ??? ?/usr/sbin/semanage [root@LENOVO-LA0X1 conf]# yum -y install policycoreutils-python.x86_64
自此,可使用了。apache