网络加速/优化器net-speeder

作者:阿川 发布时间:March 28, 2013 分类:服务器

占用内存小(5M左右),适用多平台(OpenVZ可用)
单线程下载速度提升2-10倍,抽的时候效果更明显。开启加速后,通过ssh浏览歪吐蕃的速度从十几k提升至300K+
开启加速后,1刀的vps也能用出linode的感觉
具体用法自己发掘。
一键安装代码转载于hostloc的@lazyzhu
将如下代码保存为:net_speeder_lazyinstall.sh

#!/bin/sh
 
# Set Linux PATH Environment Variables
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
 
# Check If You Are Root
if [ $(id -u) != "0" ]; then
    clear
    echo -e "\033[31m Error: You must be root to run this script! \033[0m"
    exit 1
fi
 
if [ $(arch) == x86_64 ]; then
    OSB=x86_64
elif [ $(arch) == i686 ]; then
    OSB=i386
else
    echo "\033[31m Error: Unable to Determine OS Bit. \033[0m"
    exit 1
fi
if egrep -q "5.*" /etc/issue; then
    OST=5
    wget http://dl.fedoraproject.org/pub/epel/5/${OSB}/epel-release-5-4.noarch.rpm
elif egrep -q "6.*" /etc/issue; then
    OST=6
    wget http://dl.fedoraproject.org/pub/epel/6/${OSB}/epel-release-6-8.noarch.rpm
else
    echo "\033[31m Error: Unable to Determine OS Version. \033[0m"
    exit 1
fi
 
rpm -Uvh epel-release*rpm
yum install -y libnet libnet-devel libpcap libpcap-devel gcc
 
wget http://net-speeder.googlecode.com/files/net_speeder-v0.1.tar.gz -O -|tar xz
cd net_speeder
if [ -f /proc/user_beancounters ] || [ -d /proc/bc ]; then
    sh build.sh -DCOOKED
    INTERFACE=venet0
else
    sh build.sh
    INTERFACE=eth0
fi
 
NS_PATH=/usr/local/net_speeder
mkdir -p $NS_PATH
cp -Rf net_speeder $NS_PATH
 
echo -e "\033[36m net_speeder installed. \033[0m"
echo -e "\033[36m Usage: nohup ${NS_PATH}/net_speeder $INTERFACE \"ip\" >/dev/null 2>&1 & \033[0m"

之后执行
sh net_speeder_lazyinstall.sh

项目作者:http://www.snooda.com/read/324
googe项目库:http://code.google.com/p/net-speeder/

DirectAdmin添加mod_pagespeed

作者:阿川 发布时间:March 15, 2013 分类:服务器

以下我们以CentOS为例,支持32bit或者64bit系统。首先,下载相应RPM。

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.rpm <– 32bit
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm <– 64bit

安装RPM
rpm -i –nodeps mod-pagespeed-beta_current_.rpm

当你导入RPM出错的时候..比如出现
rpm -i --nodeps mod-pagespeed-beta_current_*.rpm 
warning: mod-pagespeed-beta_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY

可以试试如下办法,根据系统版本选择签名下载.之后导入:
cd /etc/pki/rpm-gpg  
wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5  #下载最新centos5的签名 
wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6  #下载最新centos6的签名 
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*  #导入签名key