ERROR

解决方法CentOS等RedHat系的Linux为yum,Ubuntu等Debian的系的Linux为apt-get

#Linux关机时提示A stop job is running for ..
#修改配置文件
vim /etc/systemd/system.conf
DefaultTimeoutStartSec=10s
DefaultTimeoutStopSec=10s
#执行
systemctl daemon-reload
Ubuntu16.04下
#报错:E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing
#1.source本身的问题
apt-get update
#2.网络的问题
#网关错误拦截了数据包或者防火墙故意将其屏蔽在外
#Ubuntu Python报错:configure: error: no acceptable C compiler found in $PATH
#运行以下命令报错:
./configure
#解决方法:安装基础包
sudo apt-get install build-essential
#CentOS6安装MySQL5.7之后安装mysql-devel出错
#MySQL是自己编译安装,但是安装之后/etc/yum.repos.d/目录下并没有MySQL的源,导致我在安装mysql-devel出错
#当执行yum install -y mysql-devel报下方错误:
Error: Package: 1:mariadb-devel-5.5.50-1.el7_2.x86_64 (updates) 
Requires: libmysqlclient.so.18()(64bit) 
Available: 1:mariadb-libs-5.5.44-2.el7.centos.x86_64 (base) 
libmysqlclient.so.18()(64bit) 
Available: 1:mariadb-libs-5.5.47-1.el7_2.x86_64 (updates) 
libmysqlclient.so.18()(64bit) 
Available: 1:mariadb-libs-5.5.50-1.el7_2.x86_64 (updates) 
libmysqlclient.so.18()(64bit)
#安装mysql5.7的源解决
cd /etc/yum.repos.d/
rpm -ivh http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
#configure: error: MySQL library not found MySQL library not found
apt-get install libghc-hsql-mysql-dev
yum install mysql-devel
#configure error: Invalid Net-SNMP directory - unable to find net-snmp-config
apt-get install snmp snmpd
yum -y install net-snmp-devel
#依然报这个错误,则安装libsnmp-dev
apt-get install libsnmp-dev
yum install libsnmp-devel
#configure: error: unixODBC library not found
apt-get install unixodbc-dev
yum install unixODBC-devel
#configure: error: SSH2 library not found
apt-get install libssh2-1-dev
yum install libssh2
#configure: error: Invalid OPENIPMI directory - unableto find ipmiif.h
apt-get install libopenipmi-dev
yum install OpenIPMI-devel
#configure: error: OpenSSL library libssl or libcryptonot found
apt-get install libcurl4-openssl-dev
yum install openssl-devel
#configure: error: Curl library not found
apt-get install libcurl3-dev
yum install libcurl-devel
#configure: error: LIBXML2 library not found
apt-get install libxml2-dev
yum install libxml2-devel -y
#configure: error: LIBXML2 library not found
apt-get install libxml2-dev
yum install libxml2-devel -y
#configure: error: Jabber library not found
apt-get install libiksemel-dev
yum install iksemel-devel -y
#configure: error: Invalid Net-SNMP directory - unableto find net-snmp-config
apt-get install libsnmp-dev
yum install net-snmp net-snmp-devel
#configure: error: Invalid LDAP directory - unable tofind ldap.h
apt-get install libldap2-dev
yum install openldap-devel
#configure: error: Unable to use libevent (libevent check failed)
apt-get install  libevent-dev
yum install libevent-devel
#Unable to use libpcre (libpcre check failed) 
apt-get install libpcre3-dev
yum install libpcre3-devel
#Failed to fetch http://mirrors.aliyun.com/debian/dists/wheezy/InRelease Temp
解决方法:
先重启网络管理器
/etc/init.d/network-manager restart

zabbix

#php配置不符合要求
#先找到php所读的配置文件位置
php -i |grep php.ini
#然后修改为合适的值
#数据库连接报错Error connecting to database: No such file or directory
#修改php.ini,在最后添加一行:
mysqli.default_socket = /var/run/mysqld/mysqld.sock
#Unable to create the configuration file 
web服务器的用户对zabbix的前端目录的conf文件夹没有写权限,可以直接下载文件传进去或者赋权给web服务器的用户
#Database Type 不能选择MySQL的原因是没有安装php5-mysql
apt-get install php-mysql
yum install php-mysql

#php ldap off warning
#这是由于php安装的时候没有把ldap编译进去,如果php是编译安装的话,进入php的源码目录
cd ext/ldap
phpize
./configure  --with-php-config=/usr/local/php/bin/php-config --with-ldap
#如果编译报错configure: error: Cannot find ldap libraries in /usr/lib.
#- debian按下面的操作
ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so
#- centos按下面的操作
ln -s /usr/lib64/libldap.so /usr/lib/libldap.so && ln -s /usr/lib64/liblber.so /usr/lib/liblber.so
#- 再重新进行编译,编译成功之后进行安装
make && make install
#- 然后查看一下插件是否添加成功,看是否有ldap.so文件
ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/ 
# no-debug-zts-20151012不一定叫这个名字
#- 然后修改php.ini文件,在
 ; If you wish to have an extension loaded automatically, use the following
 ; syntax:下面添加一行,注意不要 ;
 extension=ldap.so
#- 重载nginx,php
nginx -s reload 
service php-fpm  reload

#login as guest zabbix无法进入登陆界面
#如果你是Apache用户,应该不存在此问题,如果是nginx有可能因为配置不当而出现,我们需要修改php.ini 
vim /usr/local/php/etc/php.ini 
#定位到你的php.ini,进行修改
cgi.fix_pathinfo=0
改为
cgi.fix_pathinfo=1

#ERROR:Get value from agent failed: cannot connect to [[1.1.1.1]:10050]: [4] Interrupted system call
#问题分析及解决:
服务端先ping zabbix-agent没问题
服务端然后telnet zabbix-agent的10050端口
如果都可以查看zabbix_web上的host配置是否正确

#报错:configure: error: no acceptable C compiler found in $PATH
#问题分析及解决:
#安装gcc套件
yum install -y gcc
yum install -y gcc-c++

#报错:configure: error: MySQL library not found
#问题分析及解决:
yum install -y mysql-devel

#报错:configure: error: Unable to use libevent (libevent check failed)
#问题分析及解决:
yum install -y libevent-devel

#错误:切换成中文后中文乱码:
#通过xftp(或其他上传工具)将字体上传至zabbix的fonts目录(zabbix的web安装路径下的fonts)
#Windows下的字体文件在C:\windows\fonts下
#zabbix 3.x
    上传至zabbix服务器的/usr/share/zabbix/fonts #zabbix文件所在目录下的fonts
#zabbix4.x
    上传至zabbix服务器的/usr/local/zabbix/html/assets/fonts/ #zabbix-web的html目录下的fonts

#nginx 403(directory index of "/var/www/html/zabbix/" is forbidden)
#原因:nginx里未配置php的允许
#解决:nginx配置文件(/etc/nginx/sites-enabled/default)里,server选项里添加index.php即可

#zabbix_agentd -c /usr/local/zabbix_agentd.conf
#zabbix_agentd [14423]: user zabbix does not exist
#zabbix_agentd [14423]: cannot run as root!
#解决方法: 
groupadd zabbix
useradd -g zabbix zabbix
usermod -s /sbin/nologin zabbix

#error: Something went wrong bootstrapping makefile fragments     for automatic dependency tracking. Try re-running configure with the
     '--disable-dependency-tracking' option to at least be able to build
     the package (albeit without support for automatic dependency tracking).
#解决方法:
yum install -y make

Mysql

密码策略问题异常信息
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
#解决方法

#1.查看mysql 初始的密码策略
SHOW VARIABLES LIKE 'validate_password%';

#2.设置密码的验证强度等级,设置 validate_password_policy 的全局参数为 LOW
set global validate_password_policy=LOW;

#3当前密码长度为 8 ,如果不介意的话就不用修改了,按照通用的来讲,设置为 6 位的密码,设置 validate_password_length 的全局参数为 6
set global validate_password_length=6;
#在默认密码的长度最小值为 4 ,由大/小写字母各一个 + 阿拉伯数字一个 + 特殊字符一个,只要设置密码的长度小于3,都将自动设值为 4

#关于 mysql 密码策略相关参数:
1).validate_password_length  固定密码的总长度;
2).validate_password_dictionary_file 指定密码验证的文件路径;
3).validate_password_mixed_case_count  整个密码中至少要包含大/小写字母的总个数;
4).validate_password_number_count  整个密码中至少要包含阿拉伯数字的个数;
5).validate_password_policy 指定密码的强度验证等级,默认为 MEDIUM;
"""validate_password_policy参数:
0/LOW:只验证长度;
1/MEDIUM:验证长度、数字、大小写、特殊字符;
2/STRONG:验证长度、数字、大小写、特殊字符、字典文件;
"""
6).validate_password_special_char_count 整个密码中至少要包含特殊字符的个数;

#避免在主机名中只使用通配符,有助于限定可以连接数据库的客户端,否则服务就开放到了公网
#执行SQL更新语句,为每个用户指定允许连接的host范围。 
1. 登录数据库,执行use mysql; 
2. 执行语句select user,Host from user where Host='%';
查看HOST为通配符的用户; 
3. 删除用户或者修改用户host字段,删除语句:DROP USER 'user_name'@'%'; 。
更新语句:update user set host = <new_host> where host = '%';。 
4. 执行SQL语句:
OPTIMIZE TABLE user;
flush privileges;

#禁用local_infile选项会降低攻击者通过SQL注入漏洞器读取敏感文件的能力
#编辑Mysql配置文件/etc/my.cnf,在mysqld 段落中配置local-infile参数为0,并重启mysql服务:

local-infile=0

SSH

#设置SSH空闲超时退出时间,可降低未授权用户访问其他用户ssh会话的风险
#编辑/etc/ssh/sshd_config,将ClientAliveInterval 设置为300到900,即5-15分钟,将ClientAliveCountMax设置为0-3之间。

ClientAliveInterval 600
ClientAliveCountMax 2

#设置密码失效时间,强制定期修改密码,减少密码被泄漏和猜测风险,使用非密码登陆方式(如密钥对)请忽略此项
#使用非密码登陆方式如密钥对,请忽略此项。在 /etc/login.defs中将 PASS_MAX_DAYS 参数设置为 60-180之间,如:
PASS_MAX_DAYS 90

#需同时执行命令设置root密码失效时间:
chage --maxdays 90 root

#设置密码修改最小间隔时间,限制密码更改过于频繁
#在 /etc/login.defs 中将 PASS_MIN_DAYS 参数设置为7-14之间,建议为7:
PASS_MIN_DAYS 7

#需同时执行命令为root用户设置:
chage --mindays 7 root

#检查密码长度和密码是否使用多种字符类型
#编辑/etc/security/pwquality.conf,把minlen(密码最小长度)设置为9-32位,把minclass(至少包含小写字母、大写字母、数字、特殊字符等4类字符中等3类或4类)设置为3或4。如:

minlen=10
minclass=3

#强制用户不重用最近使用的密码,降低密码猜测攻击风险
#在/etc/pam.d/password-auth和/etc/pam.d/system-auth中password sufficient pam_unix.so 这行的末尾配置remember参数为5-24之间,原来的内容不用更改,只在末尾加了remember=5



































































posted @ 2019-12-24 18:22  肆意的风  阅读(1535)  评论(0)    收藏  举报