Articles of centos6

为什么NTP本地软件服务器不再可用?

多年来,我有: server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 在我的/etc/ntp.confconfiguration – 它一直工作,因为我预料它:即。 大多是无用的,但是对于那些没有其他服务器可以访问的奇怪时间,这是一个后备。 我只是build立一个新的服务器CentOS 6.7,并注意到这个LOCL fudge服务器是永远不会到达。 ntpq -p的输出是: remote refid st t when poll reach delay offset jitter ============================================================================== LOCAL(0) .LOCL. 10 l 20h 64 0 0.000 0.000 0.000 我检查了我的其他服务器(都是CentOS 6.5),而且我显然没有注意到他们也是这样。 我很确定这不是这种情况,一些search暗示其他本地软件服务器不这样做。 ntp包在所有情况下都是4.2.6p5。 也许这个function已经被弃用了,如果那是什么被取代了呢? 编辑:恢复全新安装ntp.conf我没有看到现在使用这个function的build议,这是,所以这也许这是一个很好的提示,这是这种情况。 还是它不再被视为有用的? 我曾经看到过一些人提出这个build议,即使这个build议是有效的,但是我的观点是,当层级设置得足够高,其余的configuration都是合理的时候,我的观点是不会有什么坏处的。

接受一个域的所有邮件(从任何地方),将选定收件人的邮件转发到特定的地址,将所有其他邮件转发给特定的主机

我想要做的是build立一个sendmail服务器,接受所有人的邮件到一个特定的域名(比如example.com ),然后定义一个收件人列表,把这个邮件发送到指定的第三方地址上,一个特定的IP地址。 我试过这个: [root@splitter mail]# cat relay-domains example.com [root@splitter mail]# cat virtusertable [email protected] [email protected] 并且大部分域的转发工作正常 – 它被传递到由example.com的MX指定的example.com – 但exception( [email protected] )被忽略 我试过这个: [root@splitter mail]# cat local-host-names example.com [root@splitter mail]# cat mailertable example.com esmtp:[1.2.3.4] [root@splitter mail]# cat virtusertable [email protected] [email protected] 然后exception邮件正确分离,但其他任何用户在本地弹回( User unknown )。 我已经尝试添加到virtusertable : @example.com %[email protected] 但(可能并不意外),这导致rewrite: excessive recursion (max 50), ruleset canonify错误。 我更喜欢基于sendmail的解决scheme,因为我可以很快尝试这些解决scheme。 […]

Logrotate根据cron运行,但日志不旋转

我通过cron与脚本运行logrotate [alex@leia ~]$ cat /etc/cron.daily/logrotate #!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf >/dev/null EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" fi exit 0 根据系统日志,它应该工作: Dec 14 03:21:01 leia run-parts(/etc/cron.daily)[3041]: starting logrotate Dec 14 03:21:01 leia run-parts(/etc/cron.daily)[3063]: finished logrotate 我期望这也运行以下指令: [alex@leia ~]$ cat /etc/logrotate.d/www-data_uwsgi_nginx /home/www-data/*/logs/*/*log { rotate 5 size 20M nocompress […]

在nrpe插件的.py脚本中传递参数

机器A = nagios主机,机器B =边缘机器。 在机器A的host.cfg中我有: define command { command_name check_tok command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_tok 123 } define service use bg-service hostgroup_name test_oob1 service_description Recall12 check_command check_tok servicegroups nrpe } 在机器B的commands.cfg中/etc/nrpe.d我有: command[check_tok]=/usr/lib64/nagios/plugins/check_test.sh 在机器的B的/ usr / lib64 / nagios /插件,我有check_test.py和check_test.sh。 check.test.sh看起来像下面这样: #!/bin/sh /usr/bin/sudo /usr/lib64/nagios/plugins/check_test.py exit $? 和check_test.py如下所示: #!/usr/bin/env python import sys if __name__ == "__main__": […]

使用软件raid5在CentOS 6.x上安装SSD fstrim

我有一些CentOS 6.x服务器。 他们有software raid1和fstrim在那里工作得很好。 在其中一台服务器上,我决定做software raid5和ext4 。 我可以discard它,并没有错误信息。 但是,如果我决定运行fstrim ,我得到这个: [root@server ~]# fstrim / <- (raid1 works well) [root@server ~]# fstrim /SSD <- (raid5 does not work) fstrim: /SSD: FITRIM ioctl failed: Operation not supported [root@server ~]# uname -a Linux server 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 21:19:08 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux 该磁盘支持微调,并有相同的磁盘制成的RAID1。 […]

将CentOs从6.6升级到6.7

有一个问题从CentOs 6.6升级到6.7的问题。 运行yum upgrade并不像预期的那样执行,因为它不会“看见”也不build议更新到6.7。 以下是我对以下命令的看法: cat /etc/centos-release : CentOS release 6.6 (Final) yum upgrade : Loaded plugins: downloadonly, post-transaction-actions, rhnplugin, security Cleaning repos: centos6-x86_64-updates-66-20150713 centos66-x86_64 epel6-centos6-x86_64 remi remi-safe spacewalk23-client-centos6-x86_64 webtatic : zabbix20-centos6-x86_64 我假设这是一个configuration问题,导致这一点,但我找不到任何有关这个具体问题。

Fail2ban发送成功5封邮件后禁止我

亲爱的,我在CentOS 6系统上使用Fail2Ban v0.8.13来保护我的Postfix服务器。 基本上它工作,所以经过5 SMTP错误的login尝试,我被禁止。 Fail2Ban监狱conf [sasl-iptables] enabled = true filter = sasl backend = polling action = iptables[name=sasl, port=smtp, protocol=tcp] sendmail-whois[name=sasl, [email protected], [email protected]] logpath = /var/log/maillog maxretry = 5 我在main.cf中的sasl设置 smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes 我的smtp.conf(Postfix) pwcheck_method: saslauthd mech_list: login CRAM-MD5 DIGEST-MD5 我的EHLO状态(后缀) EHLO mail.xxx.ch 250-mail.xxx.ch 250-PIPELINING 250-SIZE 50480000 250-VRFY […]

每日logrotate错误创build唯一临时文件:权限被拒绝

我有一个CentOS 6.7盒,由于某种原因,无法每天旋转日志。 我每天在/ var / mail / root下收到一封类似于这个邮件的电子邮件: To: [email protected] Content-Type: text/plain; charset="ANSI_X3.4-1968" Subject: Anacron job 'cron.daily' on server.nl Message-Id: <[email protected]> Date: Wed, 9 Mar 2016 03:42:02 +0100 (CET) /etc/cron.daily/logrotate: error: error creating unique temp file: Permission denied 运行logrotate -vf /etc/logrotate.conf按预期旋转日志,不会出现错误或警告。 SELinux已启用,所以我怀疑这可能是拒绝权限错误的原因,但/var/log/audit/audit.log在过去几周内没有任何内容。 我不知道如何解决什么是导致logrotate在夜间失败,而白天工作正常,如果我手动运行它。 另外3月10日:谢谢伊恩我已经能够得到什么( /tmp/logrotate.out在夜间做的日志输出,在/tmp/logrotate.out结束是以下行: @rotating pattern: /var/log/btmp monthly (1 rotations) empty log files are […]

如何安装“memcached”到PHP 5.6?

我已经从这个源安装PHP 5.6.20。 https://webtatic.com/packages/php56/ 但是我不能安装memcached。 只是memcache。 如何安装memcache d到PHP 5.6? 这是我的尝试。 [root@testcentos ~]# yum -y install php56w-pecl-memcached.x86_64 Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile * base: mirror2.totbb.net * epel: ftp.jaist.ac.jp * extras: mirrors.nwsuaf.edu.cn * remi-safe: mirror.neolabs.kz * updates: mirror2.totbb.net * webtatic: sp.repo.webtatic.com Resolving Dependencies –> Running transaction check —> Package php56w-pecl-memcached.x86_64 […]

无法连接到mt PPTP VPN服务器

我正在按照这个教程来configuration我的centos 6 VPS和我的fedora 22工作站之间的pptp连接。 我只做了一件与本教程不同的事情:我从epel存储库安装了pptpd,而不是提供的链接。 我在教程后面添加了以下规则到我的iptables: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save iptables –table nat –append POSTROUTING –out-interface ppp0 -j MASQUERADE iptables -I INPUT -s 10.0.0.0/8 -i ppp0 -j ACCEPT iptables –append FORWARD –in-interface eth0 -j ACCEPT 我还添加了以下规则,以确保我的收费墙不会阻止我的连接请求: iptables -A INPUT -s XXX.XXX.XXX.XXX -j ACCEPT 其中XXX.XXX.XXX.XXX是我的工作站公共固定ipv4。 当我运行: pppd call pptpserver […]