CentOS防火墙开启失败怎么解决_网站服务器运行维护,centos,防火墙,开启失败

CentOS防火墙开启失败怎么解决_网站服务器运行维护,centos,防火墙,开启失败,第1张

CentOS Apache安装目录在哪_网站服务器运行维护

CentOS Apache安装目录为/etc/httpd。


apache模块目录为/usr/sbin/apachectl;web目录为/var/www/html;配置文件为/etc/httpd/conf/httpd.conf。


CentOS防火墙开启失败怎么解决_网站服务器运行维护,centos,防火墙,开启失败,第2张

CentOS防火墙开启失败怎么解决

突然之间发现centos 7 的防火墙无法启动,且firewall-cmd命令运行报错,防火墙启动报错如下:

[root@localhost firewalld]# systemctl start firewalld.service
Job for firewalld.service failed because the control process exited with error code. See "systemctl status firewalld.service" and "journalctl -xe" for details.
[root@localhost firewalld]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since 三 2020-01-08 10:43:48 CST; 10s ago
     Docs: man:firewalld(1)
  Process: 29630 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=127)
 Main PID: 29630 (code=exited, status=127)

firewall-cmd命令运行报错如下:(推荐学习:Linux视频教程)

Centos crontab不执行怎么办_网站服务器运行维护

Centos crontab不执行的解决方法:1、使用service crond start命令将cron服务打开;2、查看crontab的输出日志进行排错;3、检查crontab的表达式书写。


[root@localhost yangl]# firewall-cmd 
Traceback (most recent call last):
  File "/usr/bin/firewall-cmd", line 24, in <module>
    from gi.repository import GObject
ImportError: No module named gi.repository

究其原因是由于使用了自定义安装的python,并将自己安装的python作为默认python导致(此外,将系统默认的python升级为python3也可能会出现类似问题),因此只需将firewalld和firewall-cmd第一行调用的python改为系统的python即可解决。


我的python链接方式如下:

[root@localhost yangl]# cd /usr/bin/
[root@localhost bin]# ll python*
lrwxrwxrwx. 1 root root   16 9月  28 2018 python -> /usr/bin/python2
lrwxrwxrwx. 1 root root   39 9月  28 2018 python2 -> /share/soft/python-2.7.15/bin/python2.7
-rwxr-xr-x. 1 root root 7216 7月  13 2018 python2.7      #系统的python
lrwxrwxrwx. 1 root root    9 9月  28 2018 python2_old -> python2.7
lrwxrwxrwx. 1 root root   36 3月   7 2018 python3 -> /share/soft/python-3.6.4/bin/python3
lrwxrwxrwx. 1 root root    7 9月  28 2018 python_old -> python2

因此,只需vi打开/usr/sbin/firewalld 和/usr/bin/firewall-cmd,将其中的第一行由#!/usr/bin/python -Es 改为 #!/usr/bin/python2.7 -Es 即可!

本篇文章来自ki4网,CentOS使用教程栏目,更多相关教程请关注本栏目!

以上就是CentOS防火墙开启失败怎么解决的详细内容,更多请关注ki4网其它相关文章!

centos怎么更改语言设置为中文_网站服务器运行维护

centos更改语言设置为中文的方法是:1、首先,查看系统当前语言包与系统拥有语言包;2、然后,执行【yum install kde-l10n-Chinese】命令安装简体中文语言包;3、最后,修改配置文件即可。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/556293.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2020-03-18
下一篇 2020-03-18

发表评论

登录后才能评论

评论列表(0条)

保存