centos:测试

© ㄒiger / Posted in 主机域名 / February 7, 2012

采用yum 安装..其他方法暂无。。。

9ue.net.jpg

域名:9ue.net    nameserver:ns.tiger.im  ip:174.140.167.113

解析域名ns.tiger.im ==> 174.140.167.113 去域名注册商修改9ue.net的ns记录为ns.tiger.im

然后登陆vps 安装bind.

 yum -y install bind caching-nameserver 

安装完成后检查下,rpm -qa bind*

[root@113 ~]# rpm -qa bind*
bind-utils-9.3.6-16.P1.el5_7.1
bind-9.3.6-16.P1.el5_7.1
bind-libs-9.3.6-16.P1.el5_7.1
[root@113 ~]#

继续阅读全文... »

© ㄒiger / Posted in 主机域名 / January 12, 2012

RHEL/CentOS/Fedora使用yum update更新时,默认会升级内核。但有些服务器硬件(特别是组装的机器)在升级内核后,新的内核可能会认不出某些硬件,要重新安装驱动,很麻烦。所以在生产环境中不要轻易的升级内核,除非你确定升级内核后不会出现麻烦的问题。

如果不想升级内核而只更新其他软件包,有两种方法:

1、修改yum的配置文件 vim /etc/yum.conf,在[main]的最后添加exclude=kernel*
2、直接在yum的命令后面加上如下的参数:
yum --exclude=kernel* update

来源: http://www.ha97.com/4033.html

© ㄒiger / Posted in 主机域名 / December 22, 2011

先运行

yum install smartmontools -y

然后输入这个:

smartctl -A /dev/sda


如果不行用df看看硬盘名称,把sda换了即可

[root@server ~]# smartctl -A /dev/sda1
smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  3 Spin_Up_Time            0x0027   226   226   063    Pre-fail  Always       -       2356
  4 Start_Stop_Count        0x0032   253   253   000    Old_age   Always       -       21
  5 Reallocated_Sector_Ct   0x0033   253   253   063    Pre-fail  Always       -       0
  6 Read_Channel_Margin     0x0001   253   253   100    Pre-fail  Offline      -       0
  7 Seek_Error_Rate         0x000a   253   252   000    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0027   244   234   187    Pre-fail  Always       -       63567
  9 Power_On_Minutes        0x0032   145   145   000    Old_age   Always       -       294h+35m
 10 Spin_Retry_Count        0x002b   253   252   157    Pre-fail  Always       -       0
 11 Calibration_Retry_Count 0x002b   253   252   223    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   253   253   000    Old_age   Always       -       36
192 Power-Off_Retract_Count 0x0032   253   253   000    Old_age   Always       -       0
193 Load_Cycle_Count        0x0032   253   253   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0032   026   253   000    Old_age   Always       -       33
195 Hardware_ECC_Recovered  0x000a   253   252   000    Old_age   Always       -       421
196 Reallocated_Event_Count 0x0008   253   253   000    Old_age   Offline      -       0
197 Current_Pending_Sector  0x0008   253   253   000    Old_age   Offline      -       0
198 Offline_Uncorrectable   0x0008   253   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0008   199   199   000    Old_age   Offline      -       0
200 Multi_Zone_Error_Rate   0x000a   253   252   000    Old_age   Always       -       0
201 Soft_Read_Error_Rate    0x000a   253   252   000    Old_age   Always       -       0
202 TA_Increase_Count       0x000a   253   252   000    Old_age   Always       -       0
203 Run_Out_Cancel          0x000b   253   252   180    Pre-fail  Always       -       0
204 Shock_Count_Write_Opern 0x000a   253   252   000    Old_age   Always       -       0
205 Shock_Rate_Write_Opern  0x000a   253   252   000    Old_age   Always       -       0
207 Spin_High_Current       0x002a   253   252   000    Old_age   Always       -       0
208 Spin_Buzz               0x002a   253   252   000    Old_age   Always       -       0
209 Offline_Seek_Performnce 0x0024   240   240   000    Old_age   Offline      -       156
210 Unknown_Attribute       0x0032   253   252   000    Old_age   Always       -       0
211 Unknown_Attribute       0x0032   253   252   000    Old_age   Always       -       0
212 Unknown_Attribute       0x0032   253   252   000    Old_age   Always       -       0

其中Power_On_Hours就是硬盘使用小时了,如果是Power_On_Minutes就是硬盘使用分钟,例如:
9 Power_On_Minutes 0×0032 201 201 000 Old_age Always – 649h+23m

© ㄒiger / Posted in 主机域名,程序代码 / November 15, 2011

具体方法如下:创建一个镜像脚本centos-mirror.sh

#!/bin/sh   
   
export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"   
   
rsync="/usr/bin/rsync -aqzH --delete --delay-updates"   
   
mirror=rsync://mirrors.kernel.org/centos   
   
   
verlist="5 4"   
archlist="i386 SRPMS"   
baselist="os updates addons extras centosplus contrib fasttrack"   
local=/home/centos   
   
for ver in $verlist   
do   
        for arch in $archlist   
        do   
                for base in $baselist   
                do   
                        if [[ $ver = '4' ]] && [[ $base = 'fasttrack' ]]; then   
                                continue   
                        fi   
   
                        if [[ $ver = '5' ]] && [[ $base = 'contrib' ]]; then   
                                continue   
                        fi   
   
                        remote=$mirror/$ver/$base/$arch/   
                        mkdir -p $local/$ver/$base/$arch   
                        $rsync $remote $local/$ver/$base/$arch/   
                done   
        done   
done

设置crontab每6小时更新一次:
0 0-23/6 * * * /root/centos-mirror.sh

终端用户使用本服务器:
请参考:http://mirrors.ta139.com/CentOS-Base.repo.ta139来修改你的/etc/yum.repos.d/CentOS-Base.repo设置

上面的这些内容镜像下来大约需要50G的硬盘空间。

http://mirrors.ta139.com/pangty/show-32-1.html

© ㄒiger / Posted in 主机域名 / November 15, 2011

Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提供动态、数据库驱动网站的速度。下面我们来一步步安装memcached。
1、首先为PHP安装扩展memcache。参考如下教程。
     http://www.com.ht/90.html 

如果使用的是lnmp一键安装包(lnmp.org)的话,可以省略了。因为lnmp里面已经安装好了memcache

2、安装libevent

 

yum -y install libevent-devel

3、下载memcached

wget -c http://soft.www.com.ht/web/memcached/memcached-1.4.10.tar.gz
tar xzf memcached-1.4.10.tar.gz 
cd memcached-1.4.10

4、开始编译安装memcached

./configure --prefix=/usr/local/memcached 
make 
make install

5、配置memcached
1)下载启动脚本

wget http://soft.www.com.ht/web/memcached/memcached -O /etc/init.d/memcached 
chmod +x /etc/init.d/memcached

2)创建文件/usr/local/memcached/memcached.conf,并写入以下代码。

继续阅读全文... »