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.
/proc/sys/vm/drop_caches的值,默认为0
简单说,清除系统对内存的cache,使用root做下面几步:
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
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
sync; echo 0 > /proc/sys/vm/drop_caches
CentOS Squid Server 安装配置
[ 2011/04/14 16:38 | by Sonic ]
Squid是一个缓存internet数据的一个软件,它接收用户的下载申请,并自动处理所下载的数据。也就是说,当一个用户象要下载一个主页时,它向 Squid发出一个申请,要Squid替它下载,然后Squid 连接所申请网站并请求该主页,接着把该主页传给用户同时保留一个备份,当别的用户申请同样的页面时,Squid把保存的备份立即传给用户,使用户觉得速度相当快。
Squid代理服务器加密码验证
[ 2011/04/14 16:27 | by Sonic ]
需要用到htpasswd,这个是apahe自带。
还需要用到ncsa_auth,这个Squid自带。
sudo htpasswd -c /etc/squid/squid_passwd test
然后在/etc/squid.conf下加入:
在acl那堆配置里最后一行加入
在http_access那堆里最上一行加入
还需要用到ncsa_auth,这个Squid自带。
sudo htpasswd -c /etc/squid/squid_passwd test
然后在/etc/squid.conf下加入:
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd
在acl那堆配置里最后一行加入
acl ncsa_users proxy_auth REQUIRED
在http_access那堆里最上一行加入
http_access allow ncsa_users
分析SELinux日志,排除SELinux疑难
[ 2010/11/09 16:40 | by Sonic ]
你终有一天会被 SELinux 阻止你访问所需的东西,而且要解决这个问题。SELinux 拒绝某个文件、进程或资源被访问的基要原因有数个:
1 一个被错误标签的文件
2 一个进程在错误的 SELinux 安全性脉络下运行
3 政策出错。某个进程要访问一个在编写政策时意料不到的文件,并产生错误信息
4 一个入侵的企图。
头三个情况我们可以处理,而第四个正正是预期的表现。
1 一个被错误标签的文件
2 一个进程在错误的 SELinux 安全性脉络下运行
3 政策出错。某个进程要访问一个在编写政策时意料不到的文件,并产生错误信息
4 一个入侵的企图。
头三个情况我们可以处理,而第四个正正是预期的表现。
Centos5.4 搭建LAMP环境
[ 2010/11/09 08:47 | by Sonic ]
又在折腾CentOS,以前记住的到了再次用的时候又忘了。再次总结记录一下。
1、 安装纯净系统Centos5.4,不安装任何组件;
2、 更新系统yum update -y
3、 安装VSFTP软件 yum install vsftpd -y
4、 安装MYSQL yum install mysql-server -y
5、 安装Apache2 yum install httpd -y
1、 安装纯净系统Centos5.4,不安装任何组件;
2、 更新系统yum update -y
3、 安装VSFTP软件 yum install vsftpd -y
4、 安装MYSQL yum install mysql-server -y
5、 安装Apache2 yum install httpd -y
ubuntu桌面特效
[ 2010/06/13 11:49 | by Sonic ]
Linux统计目录下文件个数及代码行数
[ 2010/04/15 14:50 | by Sonic ]
统计cn目录下,php文件数量:
统计cn目录下所有php文件代码行数。
统计a目录下所有php文件代码行数,过滤了空行
find cn/ -name "*.php" |wc -l
统计cn目录下所有php文件代码行数。
find cn/ -name "*.php" |xargs cat|wc -l
或wc -l `find ./ -name "*.php"`|tail -n1
统计a目录下所有php文件代码行数,过滤了空行
find /a -name "*.php" |xargs cat|grep -v ^$|wc -l
修改SELinux设置,使vsftp在enforcing security enhance模式下正常运行
[ 2010/03/16 15:36 | by Sonic ]
开了SELinux和防火墙,没想到引出了vsftp的问题。FTP登录报错:500 OOPS: cannot change directory。下面来看看产生这个问题的原因和对策。
从Red Hat Enterprise Linux 5 server升级到CentOS 5.4
[ 2010/03/15 17:17 | by Sonic ]
手里在管理的几台服务器,其中之一直在用Red Hat Enterprise Linux 5 Server,需要续费升级很让人别扭。特别是另外一台机器用了CentOS 5.4之后,yum update的痛快,让RHEL 5上,rpm -Uvh更显得痛苦了。动手升到到CentOS 5.4吧。MS应该好好向Linux学学了,切换操作系统都不需要重启。网络服务一点都不耽误。上午刚刚听一个朋友抱怨,正版Vista自动官方升级。升级之后就再也进不去系统了。差距咋那么大呢?
linux服务器,针对某一客户优化网速
[ 2010/03/10 14:30 | by Sonic ]
web服务器,自己公司用网通线路访问速度很好。在同一城市,同在网通线路的客户却速度极慢。
tracert得到客户公司网关地址后,可以用以下方法专门针对客户公司网络优化链接速度。
route add -net 202.91.0.0 netmask 255.255.0.0 gw 122.xxx.xxx.225
tracert得到客户公司网关地址后,可以用以下方法专门针对客户公司网络优化链接速度。
route add -net 202.91.0.0 netmask 255.255.0.0 gw 122.xxx.xxx.225
crontab命令格式
[ 2010/03/04 13:46 | by Sonic ]
经常用,但是经常忘记,基本的格式能记得,但是详细的或者复杂点的格式总会忘记或者拿不准,不知道是不是年纪大了记忆力下降,干脆整理出来今后方便查看。
linux的启动进程与服务
[ 2010/03/03 08:39 | by Sonic ]
当年对dos开机流程熟知,帮助我解决了不少问题。对于Linux的研究自然也少不了这部分基础知道。LINUX的启动过程究竟是怎么样的?它要启动哪些服务?这些服务是做什么用的? deflag的这篇文章值得一读。





Flash Player文件
