Articles of centos

GREP显示包含这个但不是那个的行

我想search包含“已上传”但不包含“09” 有没有办法做到这一点与grep? (如果有关系的话,CentOS 5.6)。

为什么不是每分钟都运行crontab

我有一个需要每分钟运行的cron 我试过了 1 * * * * php /scripts/cron.php 但似乎不是每分钟都跑,为什么? 由于在分钟标签中,我每分钟input一个 但是下面每分钟都会运行 * * * * * php /scripts/cron.php

在CentOS 6上configurationIptables将我locking

我以root身份运行以下bash脚本来configurationiptables(我通过SSHlogin): #!/bin/bash # Delete all existing rules iptables –flush # Set default chain policies iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT DROP # Allow port 80 (http) iptables -A INPUT -p tcp –sport 80 -j ACCEPT iptables -A OUTPUT -p tcp –dport 80 -j ACCEPT # Allow port 443 (https) iptables […]

不断监测许多服务器的健康的简单方法?

我正在运行CentOS上运行的几个Web代理服务器,我正在寻找一种简单的方式来持续监视服务器的运行状况(他们响应Web请求的速度有多快,网页的加载速度等) 我正在考虑可能是一个Web界面(PHP脚本也许?),或可能使用bash提示工具。 什么是这样做的简单方法? 谢谢!

帮助设置NSD守护进程(DNS服务器)

当search一个安全的DNS服务器时,我遇到了NSD项目 。 在我看来,这是开源的最佳select,给我留下了深刻的印象。 一个问题认为他们的“教程”真的不是初学者友好的。 我有基本的DNS知识,但有什么是在我的联赛。 我需要在这个CentOS服务器上有多个站点,我最近得到了我的手。 他们还需要收到电子邮件。 细节: 我有一个主控主机,并希望按照以下行中描述的方式进行设置: masterhost.com -> ns1.masterhost.com mail.masterhost.com www.masterhost.com addonhost.com -> ns1.masterhost.com mail.masterhost.com www.addonhost.com 等等。 请帮忙设置这个DNS服务器吗? 欢迎所有的答案和build议。 先谢谢你。

Solaris或Centos

这可能是太开放的问题。 我一直在使用Centos,但从不尝试Solaris。 公司需要设置4个新的Web服务器来托pipePHP Web应用程序(外部MSSQL数据库服务器)。 我想现在是提问这个问题的机会。 道歉,如果我的问题是有点在那里。 提前致谢。 蒂姆

针对多个域的Apache反向代理configuration

我是新手。 我有1个LAMP CentOS服务器,它使用以下Apache httpd.confconfiguration托pipe3个网站: NameVirtualHost *:80 NameVirtualHost *:443 <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /home/www/html/domaina.com ServerName www.domaina.com ServerAlias *.domaina.com ScriptAlias /cgi-bin/ "/home/www/html/domaina.com/cgi-bin/" RewriteEngine On RewriteOptions Inherit ErrorLog /home/log/domaina.com-error_log CustomLog /home/log/domaina.com-access_log common </VirtualHost> <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key ServerAdmin [email protected] DocumentRoot /home/www/html/domaina.com ServerName www.domaina.com ServerAlias *.domaina.com ScriptAlias /cgi-bin/ "/home/www/html/domaina.com/cgi-bin/" RewriteEngine On RewriteOptions Inherit ErrorLog […]

服务器使用交换,剩下大量资源

我有一个交换256 MB的Centos 7。 我一直有至less1GB的空闲RAM内存,我的CPU永远不会超过60%的使用量。 但任何时候我检查交换使用它使用大约200 MB! 我的Swappiness是30,一切正常。 但我真的很好奇这个Centos正在发生什么。 我正在运行LAMP,就是这样,没有什么幻想。 那么,我该如何摆脱这种交换高使用率呢? 是否可以检查谁/写什么应用程序? 按要求, free -m输出: total used free shared buff/cache available Mem: 1991 171 1684 2 134 1771 Swap: 255 239 16 我发现Apache正在交换很多东西。 我有很多空闲的内存,为什么交换? 检查下面的图像。 图片http://oi57.tinypic.com/r23kh2.jpg来自http://tinypic.com/view.php?pic=r23kh2&s=8#.Vfr74PlViko 所以SO不允许我发布图片,所以我发布在上面的链接。

只有在MongoDB在CentOs 7中运行一次才运行rc.local

我在我的rc.local有以下脚本: 这将在端口8080,8081,8082,8083上运行服务。它们实际上是需要mongod启动的节点服务器。 所以,我编辑了/lib/systemd/system/rc-local.service并添加了: After=network.target syslog.target mongod.service 但是否:脚本仍然失败,因为在运行时,他们发现数据库服务器已closures。 我可能做错了什么? 我将如何debugging? 更新 :现在,我添加了After= ,错误是不是mongoDb连接(我正在看旧日志),而是事实上,RC本地似乎并没有开始。 手动运行systemctl restart rc-local.service虽然工作… 更新2 :通过采取syslog.target出来,所以有: After=network.target mongod.service 有服务器的HALF(4个中的2个)启动正常,另一个HALF无法连接到数据库的奇怪副作用。 这让我认为systemd运行mongodb,但是当rc-local运行时还没有准备好连接

maillog“没有路由到主机”的错误

我有一个CentOS服务器。 它安装了sendmail,但不用于邮件服务器。 我将根邮件转发到另一个电子邮件地址。 但是,我不断收到maillog中的错误: Dec 6 08:49:16 server1 sm-msp-queue[16191]: qB6601et005433: to=root, ctladdr=root (0/0), delay=08:49:15, xdelay=00:00:00, mailer=relay, pri=883224, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: [127.0.0.1]: No route to host Dec 6 08:49:16 server1 sendmail[16190]: qB39nDfQ014062: to=<[email protected]>, delay=3+05:00:02, xdelay=00:00:00, mailer=esmtp, pri=6965048, relay=subdomain.example.com., dsn=4.0.0, stat=Deferred: subdomain.example.com.: No route to host Dec 6 08:49:16 server1 sendmail[16190]: qB39nDfR014062: to=<[email protected]>, delay=3+05:00:02, xdelay=00:00:00, mailer=esmtp, pri=7004959, […]