squid3.0 代理缓存配置

wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE25.tar.gz
tar zxvf squid-3.0.STABLE25.tar.gz
cd squid-3.0.STABLE25


./configure –prefix=/usr/local/squid3 \
–enable-async-io=100 \
–with-pthreads \
–enable-storeio=”aufs,diskd,ufs” \
–enable-removal-policies=”heap,lru” \
–enable-icmp \
–enable-delay-pools \
–enable-useragent-log \
–enable-referer-log \
–enable-kill-parent-hack \
–enable-arp-acl \
–enable-default-err-language=Simplify_Chinese \
–enable-err-languages=”Simplify_Chinese English” \
–disable-poll \
–disable-wccp \
–disable-wccpv2 \
–disable-ident-lookups \
–disable-internal-dns \
–enable-basic-auth-helpers=”NCSA” \
–enable-stacktrace \
–with-large-files \
–disable-mempools \
–with-filedescriptors=65536 \
–enable-ssl \
–enable-x-accelerator-var Continue reading

CentOS setup命令

最小化安装CentOS后,没有setup命令,后用yum install setuptool安装了setup,可是运行时只有Authentication configuration和Firewall configuration两项,没有时区、系统服务等其他几项,有时候新手会很痛苦,其实用以下命令你就可以找到你想要的项目啦。

yum install setuptool
yum install ntsysv

CentOS 定义yum的非官方库

在服务器构建的过程中,我们将要用到的一些工具不存在于CentOS中yum的官方库中,所以需要定义yum的非官方库文件,让一些必需的工具通过yum也能够安装。

[root@www.banyue.net]# vi /etc/yum.repos.d/dag.repo ← 建立dag.repo,定义非官方库

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl= http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1 

[root@sample ~]# rpm –import  http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt ← 导入非官方库的GPG

装完CentOS要做的三件事

(1)关闭不需要的服务
以下仅列出需要启动的服务,未列出的服务一律关闭:
crond
irqbalance 仅当服务器CPU为S.M.P架构或支持双核心、HT技术时,才需开启,否则关闭。
microcode_ctl
network
iptables
vsftpd
sshd
syslog
yum-updatesd

(2)安装 yum软件 yum-fastestmirror,自动选择比较快的源
yum upgrade
建议更新所有列出的程序,包括内核,rhel 5.X的稳定性还要继续努力呢。

(3)定时校正服务器时间
# yum install -y ntp
# crontab -e
0 23 * * * /usr/sbin/ntpdate 210.72.145.44
以上命令设置好后存盘。
# /sbin/service crond reload
重载计划任务配置