Articles of centos

使用logrotate旋转Iptables日志

我正在运行CentOS6,并configuration了rsyslog来监视我的iptables警告消息,并将它们转储到/var/log/iptables.log 。 我经历了我的logrotate.d/syslog文件,并添加iptables.log所以logrotate将拿起并旋转日志。 该文件如下所示: /var/log/cron /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler /var/log/iptables.log { sharedscripts postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true endscript } 但是,当我运行logrotate -f -v logrotate.conf来触发一个强制滚动时,iptables.log文件不会滚动。 为了使logrotate不是iptables文件上的iptables.log-20121014 ,我创build了一个iptables.log-20121014文件。 我运行命令时的输出如下所示: rotating log /var/log/iptables.log, log->rotateCount is 4 dateext suffix '-20121021' 我正在失望。 我如何获得logrotate滚动文件? 我不是100%确定,如果我configuration正确,但我不知道足以确定如果是这样的话。

在Centos5.8上安装jdk7u7

我试图在Linux CentosOS 5.8上安装Java SDK(jdk-7u7-linux-i586.rpm)。 我正在使用本指南 ,并从Oracle网站下载所有内容。 执行rpm -Uvh /path/to/binary/jdk-7u7-linux-i586.rpm ,软件包正在安装java: [root@ip-***-***-**-189 java]# rpm -Uvh jdk-7u7-linux-i586.rpm Preparing… ########################################### [100%] 1:jdk ########################################### [100%] 但完成后,我得到这些错误: Unpacking JAR files… rt.jar… Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/rt.pack jsse.jar… Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/jsse.pack charsets.jar… Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/charsets.pack tools.jar… Error: Could not open input […]

允许sudo删除某些文件

我想允许删除/ tmp目录中的某些文件来sudo用户。 我为sudo用户添加了Allow_Cmnd /usr/sbin/userdel ,但不会删除与用户关联的所有/ tmp文件。 那么我应该如何调整sudoers,让它们只删除/ tmp目录中的某些文件。 我GOOGLE了一下,但得知正则expression式可能是在这个应用程序。 我尝试了一些调整,但它不为我工作。 我希望用户有能力执行命令,如 find /tmp -uid 10002 | grep joeuser | xargs rm -rf

如何安装64位版本的Mongodb

我如何安装64位(x86_64)版本的MongoDB? 我在10gen.repo中指定了64bit: baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 但是当我运行: yum install mongo-10gen mongo-10gen-server 这是32位(见i686),它被设置为安装。 Failed to set locale, defaulting to C Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.fdcservers.net * epel: mirror.steadfast.net * extras: mirror.fdcservers.net * rpmforge: mirror.rit.edu * updates: mirror.fdcservers.net 10gen | 951 B 00:00 Not using downloaded repomd.xml because it is older than what […]

如何在OpenVZ centos6容器中drop_caches

我努力了 sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches' sudo echo 3 > /proc/sys/vm/drop_caches echo 3 > /proc/sys/vm/drop_caches echo 3 | sudo tee /proc/sys/vm/drop_caches 和一堆其他的变化,但与我得到的每一个尝试 bash: /proc/sys/vm/drop_caches: Permission denied 如何清除用于缓冲区/caching在我的centos6 openvz容器内存? 这似乎是唯一的方法来做我所需要的是重新启动容器。

在CentOS 6.3上安装CutyCapt

我正试图在CentOS 6.3上安装CutyCapt yum install Xvfb yum install xorg-x11-fonts* yum install subversion libqt4-webkit libqt4-dev 我在安装libqt4-webkit和libqt4-dev时遇到问题 我有这个链接 我尝试了解决scheme,但没有帮助。 请给我一个方法

ext4内核恐慌

我得到这样的内核恐慌: EXT4-fs error (device md2): ext4_ext_find_extent: bad header/extent in inode #97911179: invalid magic – magic 5f69, entries 28769, max 26988(0), depth 24939(0) ———– [cut here ] ——— [please bite here ] ——— Kernel BUG at fs/ext4/extents.c:1973 invalid opcode: 0000 [1] SMP last sysfs file: /devices/pci0000:00/0000:00:00.0/irq CPU 6 Modules linked in: iptable_filter ipt_REDIRECT ip_nat_ftp ip_conntrack_ftp iptable_nat […]

CentoOS SSH访问

我用root用户执行这个命令,我在CentOS 6.3服务器上: #useradd newuser #passwd newuser #visudo 然后我在文件的末尾添加了这一行: AllowUsers newuser #service sshd restart #exit 现在,我无法使用部署者或root用户访问服务器! 两个帐户都返回: **Permission denied, please try again.** 有什么build议么? 编辑:为什么添加AllowUsers newuser不允许新用户通过SSHlogin?

无法访问我的服务器上的戴尔OMSA网页

我在Dell PowerEdge R520上运行CentOS 6.3 x64。 按照这个Wiki,我运行了以下两个命令 sudo wget -q -O – http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash sudo yum install srvadmin-all 所有相关的服务似乎都在运行。 但是,当我尝试访问 http://myserver:1311 该页面不能parsing。 当我尝试从物理服务器访问网页时,会看到一个包含4个框和一个问号的页面。 任何帮助深表感谢。 编辑:显然我吸了一个质量问题。 问题是当我试图从另一台机器访问我的服务器的OMSA网页时,页面将“无法加载”。 但是,如果我在安装了OMSA的服务器上打开Web浏览器,则会出现一个包含四个框和一个问号的页面。 原来,我只是没有打开适当的端口。 我向你们所有人表示歉意,感谢你们的帮助。

按字母顺序排列的Apache2默认虚拟主机,或用_default_虚拟主机覆盖?

我在Apache Web服务器上有多个命名的虚拟主机(CentOS 5,Apache 2.2.3)。 每个虚拟主机在/etc/httpd/vhosts.d都有自己的configuration文件,这些虚拟主机configuration文件包含在主httpd conf中, Include vhosts.d/*.conf 这里有一个虚拟主机的例子 NameVirtualHost *:80 <VirtualHost *:80> ServerName www.domain.biz ServerAlias domain.biz www.domain.biz DocumentRoot /var/www/www.domain.biz <Directory /var/www/www.domain.biz> Options +FollowSymLinks Order Allow,Deny Allow from all </Directory> CustomLog /var/log/httpd/www.domain.biz_access.log combined ErrorLog /var/log/httpd/www.domain.biz_error.log </VirtualHost> 现在,当任何人试图直接通过公共IP地址访问服务器时,他们会得到在聚合configuration中指定的第一个虚拟主机(所以在我的情况下,它是从vhosts.d目录的字母顺序)。 任何人通过IP地址直接访问服务器,我想他们只是得到一个403或404。 我发现了几种设置默认/全部虚拟主机和一些相互矛盾的观点的方法。 我可以在vhosts.d中创build一个叫做000aaadefault.conf的新的虚拟主机configuration文件,但是这有点令人讨厌。 在包含vhosts.d目录之前,我可以在主httpd.conf有一个<VirtualHost>块。 我可以在我的主httpd.conf指定一个DocumentRoot 那么在httpd.conf中用_default_ http://httpd.apache.org/docs/2.2/vhosts/examples.html#default指定默认虚拟主机 在Include vhosts.d/*.conf之前,在我的httpd.conf有一个<VirtualHost _default_:*>块是否是最好的方式?