贴一份优化配置,备查 继续阅读Mysql优化
分类: 网事-网摘
清除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 安装配置
Squid代理服务器加密码验证
需要用到htpasswd,这个是apahe自带。
还需要用到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疑难
你终有一天会被 SELinux 阻止你访问所需的东西,而且要解决这个问题。SELinux 拒绝某个文件、进程或资源被访问的基要原因有数个:
1 一个被错误标签的文件
2 一个进程在错误的 SELinux 安全性脉络下运行
3 政策出错。某个进程要访问一个在编写政策时意料不到的文件,并产生错误信息
4 一个入侵的企图。
头三个情况我们可以处理,而第四个正正是预期的表现。
继续阅读分析SELinux日志,排除SELinux疑难
Centos5.4, 6, 7 搭建LAMP环境
又在折腾CentOS,以前记住的到了再次用的时候又忘了。再次总结记录一下。
1、 安装纯净系统Centos5.4,不安装任何组件; 2、 更新系统yum update -y 3、 安装VSFTP软件 yum install vsftpd -y 4、 安装MYSQL yum install mysql-server mysql mysql-devel -y
CentOS7
yum install mariadb-server mariadb
5、 安装Apache2 yum install httpd -y
yum -y install epel-release yum -y install yum-axelget yum clean all && yum makecache && yum -y update
echo -e “\nalias vi=vim\nalias grep=’grep –color’\n” >>~/.bashrc && source ~/.bashrc