安装cband控制apache流量

wget http://cband.linux.pl/download/mod-cband-0.9.7.4.tgz
tar xzvf mod-cband-0.9.7.4.tgz
cd mod-cband-0.9.7.4
./configure
make
make install

configure之前,可能提示没有apx2。需要先yum install httpd-devel。此时确保Testing.repo关闭。

The make install command should have added the mod_cband module to /etc/apache2/httpd.conf. Run

vi /etc/apache2/httpd.conf

and check if you find a line like this:

LoadModule cband_module       /usr/lib/apache2/modules/mod_cband.so

(If you don’t find this line, add it yourself.)

详细解析Linux scp命令的应用

Linux scp命令用于Linux之间复制文件和目录,具体如何使用这里好好介绍一下,从本地复制到远程、从远程复制到本地是两种使用方式。具体举例:

==================
Linux scp 命令
==================

scp 可以在 2个 linux 主机间复制文件;

命令基本格式:

scp [可选参数] file_source file_target

======

从 本地 复制到 远程

======

* 复制文件:

* 命令格式:

scp local_file remote_username@remote_ip:remote_folder

或者

scp local_file remote_username@remote_ip:remote_file

或者

scp local_file remote_ip:remote_folder

或者

scp local_file remote_ip:remote_file

第1,2个指定了用户名,命令执行后需要再输入密码,第1个仅指定了远程的目录,文件名字不变,第2个指定了文件名;

第3,4个没有指定用户名,命令执行后需要输入用户名和密码,第3个仅指定了远程的目录,文件名字不变,第4个指定了文件名;

* 例子:

scp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/music

scp /home/space/music/1.mp3 root@www.cumt.edu.cn:/home/root/others/music/001.mp3

scp /home/space/music/1.mp3 www.cumt.edu.cn:/home/root/others/music

scp /home/space/music/1.mp3 www.cumt.edu.cn:/home/root/others/music/001.mp3

* 复制目录:

* 命令格式:

scp -r local_folder remote_username@remote_ip:remote_folder

或者

scp -r local_folder remote_ip:remote_folder

第1个指定了用户名,命令执行后需要再输入密码;

第2个没有指定用户名,命令执行后需要输入用户名和密码;

* 例子:

scp -r /home/space/music/ root@www.cumt.edu.cn:/home/root/others/

scp -r /home/space/music/ www.cumt.edu.cn:/home/root/others/

上面 命令 将 本地 music 目录 复制 到 远程 others 目录下,即复制后有 远程 有 ../others/music/ 目录

======

从 远程 复制到 本地

======

从 远程 复制到 本地,只要将 从 本地 复制到 远程 的命令 的 后2个参数 调换顺序 即可;

例如:

scp root@www.cumt.edu.cn:/home/root/others/music /home/space/music/1.mp3

scp -r www.cumt.edu.cn:/home/root/others/ /home/space/music/

最简单的应用如下 :

scp 本地用户名 @IP 地址 : 文件名 1 远程用户名 @IP 地址 : 文件名 2

[ 本地用户名 @IP 地址 :] 可以不输入 , 可能需要输入远程用户名所对应的密码 .

可能有用的几个参数 :

-v 和大多数 linux 命令中的 -v 意思一样 , 用来显示进度 . 可以用来查看连接 , 认证 , 或是配置错误 .

-C 使能压缩选项 .

-P 选择端口 . 注意 -p 已经被 rcp 使用 .

-4 强行使用 IPV4 地址 .

-6 强行使用 IPV6 地址 .

Linux scp命令的使用方法应该可以满足大家对Linux文件和目录的复制使用了。

清除Linux缓存

Writing to this will cause the kernel to drop clean caches, dentries and
inodes from memory, causing that memory to become free.

To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation and dirty objects are not freeable, the
user should run `sync’ first.

[root@server test]# cat /proc/sys/vm/drop_caches
0

/proc/sys/vm/drop_caches的值,默认为0
简单说,清除系统对内存的cache,使用root做下面几步:

sync; echo 3 > /proc/sys/vm/drop_caches
sync; echo 0 > /proc/sys/vm/drop_caches

CentOS Squid Server 安装配置

Squid是一个缓存internet数据的一个软件,它接收用户的下载申请,并自动处理所下载的数据。也就是说,当一个用户象要下载一个主页时,它向 Squid发出一个申请,要Squid替它下载,然后Squid 连接所申请网站并请求该主页,接着把该主页传给用户同时保留一个备份,当别的用户申请同样的页面时,Squid把保存的备份立即传给用户,使用户觉得速度相当快。 继续阅读CentOS Squid Server 安装配置