01 2015 档案

摘要:Nginx配置文件详细说明在此记录下Nginx服务器nginx.conf的配置文件说明.#运行用户user www-data; #启动进程,通常设置成和cpu的数量相等worker_processes 1;#全局错误日志及PID文件error_log /var/log/nginx/error.log... 阅读全文
posted @ 2015-01-30 16:26 麦田守望者~ 阅读(100) 评论(0) 推荐(0) 编辑
摘要:一:nginx反向代理实现nginx+apache动静分离-------------概念---------------------------nginx反向代理服务器+负载均衡用nginx做反向代理和负载均衡非常简单,支持两个用法 1个proxy, 1个upstream,分别用来做反向代理,和负载均... 阅读全文
posted @ 2015-01-30 16:07 麦田守望者~ 阅读(304) 评论(0) 推荐(0) 编辑
摘要:帮助信息./configure -help|grep mysql安装php./configure --prefix=/usr/local/fastphp --with-mysql=mysqlnd\--enable-mysqld\--with-gd\--enable-gd-native-ttf\--e... 阅读全文
posted @ 2015-01-29 18:02 麦田守望者~ 阅读(214) 评论(0) 推荐(0) 编辑
摘要:setReadDataOnly(true); $objPHPExcel = $objReader->load($filename); $objWorksheet = $objPHPExcel->getActiveSheet(); $highestRo... 阅读全文
posted @ 2015-01-29 15:58 麦田守望者~ 阅读(445) 评论(0) 推荐(0) 编辑
摘要:一:nginx 中配置 expires缓存提升网站负载对于网站的图片,尤其是新闻站, 图片一旦发布, 改动的可能是非常小的.我们希望 能否在用户访问一次后, 图片缓存在用户的浏览器端,且时间比较长的缓存.可以, 用到 nginx的expires设置 .nginx中设置过期时间,非常简单,在locat... 阅读全文
posted @ 2015-01-29 00:36 麦田守望者~ 阅读(392) 评论(0) 推荐(0) 编辑
摘要:一:nginx gzip压缩提升网站速度我们观察news.163.com的头信息请求:Accept-Encoding:gzip,deflate,sdch响应:Content-Encoding:gzipContent-Length:36093再把页面另存下来,观察,约10W字节,实际传输的36093字... 阅读全文
posted @ 2015-01-28 23:16 麦田守望者~ 阅读(216) 评论(0) 推荐(0) 编辑
摘要:一:URL 重写 ecshop案例Rewrite语法Rewrite 正则表达式 定向后的位置 模式Goods-3.html ---->Goods.php?goods_id=3goods-([\d]+)\.html ---> goods.php?goods_id =$1 location /ecs... 阅读全文
posted @ 2015-01-28 17:29 麦田守望者~ 阅读(337) 评论(0) 推荐(0) 编辑
摘要:一: nginx上安装ecshop 案例(1)解压到 nginx/html下 浏览器访问:127.0.0.1/ecshop/index.php 出现错误:not funod file 原因:nginx 中 nginx.conf location 没有默认的index.php ... 阅读全文
posted @ 2015-01-28 16:16 麦田守望者~ 阅读(1941) 评论(0) 推荐(0) 编辑
摘要:帮助信息./configure -help|grep mysql出错提示安装libxml2 tar -zxvf libxml2xxxx.tarcd libxml2xxx./configure make && make install------------------安装 gd库yum instal... 阅读全文
posted @ 2015-01-27 17:18 麦田守望者~ 阅读(284) 评论(0) 推荐(0) 编辑
摘要:一:编译PHP并与nginx整合 【yum安装方式】yum搭建lnmp环境(CentOS6.4)1.关闭防火墙[root@CentOS ~]# chkconfig iptables off2.关闭selinuxvi /etc/sysconfig/selinux //将SELINUX=enforcin... 阅读全文
posted @ 2015-01-27 17:10 麦田守望者~ 阅读(166) 评论(0) 推荐(0) 编辑
摘要:一:Rewrite(重写)详细解析rewrite 重写重写中用到的指令if (条件) {} 设定条件,再进行重写set #设置变量return #返回状态码break #跳出rewriterewrite #重写If 语法格式If 空格 (条件) { 重写模式}条件又怎么写?答:3种写法1: “=”来... 阅读全文
posted @ 2015-01-27 10:39 麦田守望者~ 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2015-01-26 17:23 麦田守望者~ 阅读(146) 评论(0) 推荐(0) 编辑
摘要:一:Location之正则匹配再来看,正则也来参与.location / { root /usr/local/nginx/html; index index.html index.htm; }location ~ image { root /var/www/image; index index.ht... 阅读全文
posted @ 2015-01-26 16:29 麦田守望者~ 阅读(172) 评论(0) 推荐(0) 编辑
摘要:一:Location详解之精准匹配location 语法location 有”定位”的意思, 根据Uri来进行不同的定位.在虚拟主机的配置中,是必不可少的,location可以把网站的不同部分,定位到不同的处理方式上.比如, 碰到.php, 如何调用PHP解释器? --这时就需要locationlo... 阅读全文
posted @ 2015-01-26 15:43 麦田守望者~ 阅读(1572) 评论(0) 推荐(0) 编辑
摘要://获取当前的url var url=document.location.href; var url_cn='http://www.macau-airport.com/cn/our-business/for-rental/mia-tender-notice'; va... 阅读全文
posted @ 2015-01-26 11:14 麦田守望者~ 阅读(544) 评论(0) 推荐(0) 编辑
摘要:一:nginx日志切割 (1) 新建一个data目录 [root@localhost nginx]# mkdir /data (2) 新建一个shell脚本 [root@localhost data]# vi runlog.sh (3) 编写shell脚本 #需要切割日... 阅读全文
posted @ 2015-01-22 17:33 麦田守望者~ 阅读(1344) 评论(0) 推荐(0) 编辑
摘要:date -s '2015-01-22 13:00:22' #设置时间clock -w #写入mac操作系统中-------------------------------------date -d yesterday +%y%m%d #改成时间搓格式 如:20150122 阅读全文
posted @ 2015-01-22 14:57 麦田守望者~ 阅读(481) 评论(0) 推荐(0) 编辑
摘要:一:nginx日志管理我们观察nginx的server段,可以看到如下类似信息 #access_log logs/host.access.log main;这说明 该server, 它的访问日志的文件是 logs/host.access.log ,使用的格式”main”格式.除了main格式,... 阅读全文
posted @ 2015-01-22 14:48 麦田守望者~ 阅读(143) 评论(0) 推荐(0) 编辑
摘要:一:nginx虚拟主机配置#user nobody;#只有一个工作子进程,可以自行修改,但太无益,因为要占用CPU,一般设置为 CPU数*核数worker_processes 1;#error_log logs/error.log;#error_log logs/error.log no... 阅读全文
posted @ 2015-01-22 11:16 麦田守望者~ 阅读(105) 评论(0) 推荐(0) 编辑
摘要:一:nginx信号量 (1)nginx重启 关闭 1: ps aux|grep nginx 查看所有有关nginx的进程 2: kill -INT 26652 禁止26652进程 3: ./sbin/nfinx 启动nginx 4: ki... 阅读全文
posted @ 2015-01-21 11:34 麦田守望者~ 阅读(218) 评论(0) 推荐(0) 编辑
摘要:一:linux上安装 nginx 下载nginx:wget http://nginx.org/download/nginx-1.6.2.tar.gz 解压:tar zxvf nginx-1.6.2.tar.gz 进入nginx目录: cd nginx 安装:./configure --prefix=/usr/local/nginx 出现一个错误提示说没安装 pcre【正则模块】 安装pcre:... 阅读全文
posted @ 2015-01-20 17:44 麦田守望者~ 阅读(194) 评论(0) 推荐(0) 编辑
摘要:#添加一个用户useradd xiaoming#设置密码passwd xiaoming 回程//设置密码就行了#把用户修改成root权限vi /etc/passwd #找到xiaoming:x:508:508::/home/xiaoming:/bin/bash 改后面的 508 为和roo... 阅读全文
posted @ 2015-01-20 16:13 麦田守望者~ 阅读(736) 评论(0) 推荐(0) 编辑
摘要:一:Memcached 永久数据被踢现象(1)网上有人反映"memcached"数据丢失,明明设为永久不失效,却莫名其妙的丢失了。 其实这要从2个方面来找原因。 即使前面介绍的惰性删除与LRU最近最少使用记录 提示: (1)数据在内存中并未真正的删除系统也不知道某个item已失效,下次去get... 阅读全文
posted @ 2015-01-15 15:50 麦田守望者~ 阅读(606) 评论(0) 推荐(0) 编辑
摘要:第一阶段: (PHP+MySQL核心编程)面向对象编程MySQL数据库,MySQL的优化细节。HTTP协议,http也是我们web开发的基石。对我们了解PHP底层机制有很大帮助,做到知其然,还知其所以然。数据库编程(mysql mysqli pdo),MySQL扩展库、MySQLI扩展库和PDO方式... 阅读全文
posted @ 2015-01-15 15:16 麦田守望者~ 阅读(204) 评论(0) 推荐(0) 编辑
摘要:一:Memcached 缓存无底洞现象(1)facebook的工作人员反应的,facebook在2010年左右,memcached节点就已经达到了3000个,存储的数据进千G的数据存储。 他们发现一个问题,memecached连接频率,效率都下降了,于是加了memcached节点.添加节点后发... 阅读全文
posted @ 2015-01-15 14:34 麦田守望者~ 阅读(396) 评论(0) 推荐(0) 编辑
摘要:Memcache常用方法 Memcache::add — 添加一个值,如果已经存在,则返回false Memcache::addServer — 添加一个可供使用的服务器地址 Memcache::close — 关闭一个Memcache对象 Memcache::connect — 创建一个Memca... 阅读全文
posted @ 2015-01-15 11:59 麦田守望者~ 阅读(278) 评论(0) 推荐(0) 编辑
摘要:这里收集了经常被问到的关于memcached的问题 * memcached是怎么工作的? * memcached最大的优势是什么? * memcached和MySQL的query cache相比,有什么优缺点? * memcached和服务器的local cache(比如PHP的APC、mmap文件... 阅读全文
posted @ 2015-01-15 11:52 麦田守望者~ 阅读(305) 评论(0) 推荐(0) 编辑
摘要:一:Memcached 缓存雪崩现象(1)造成原因:一般是由某个节点失效,导致其他的节点的缓存命中率下降,缓存中缺失的数据查询,短时间内造成的数据库服务器奔溃。重启DB,短期内又被压垮,但缓存的数据增加了一些,DB反复的多次的启动,多次缓存才能建立完毕,DB才能稳定的运行。或者是由于缓存周期性的失效... 阅读全文
posted @ 2015-01-15 11:50 麦田守望者~ 阅读(483) 评论(0) 推荐(0) 编辑
摘要:http://www.hcharts.cn/ 阅读全文
posted @ 2015-01-14 17:09 麦田守望者~ 阅读(148) 评论(0) 推荐(0) 编辑
摘要:1 _hash($key);31 $node=current($this->_position);//先取圆环上最小的一个节点32 #循环所以节点33 foreach($this->_nodes as $k=>$v){34 #... 阅读全文
posted @ 2015-01-13 16:38 麦田守望者~ 阅读(183) 评论(0) 推荐(0) 编辑
摘要:一:Memcached 分布式之取模算法的缺陷(1)假设你有8台服务器,运行中突然down一台,则求余数的底数就7. 后果: key_0%8==0 ,key_0%7==0 =>hist(命中) .... .... key_... 阅读全文
posted @ 2015-01-13 14:18 麦田守望者~ 阅读(238) 评论(0) 推荐(0) 编辑
摘要:1 ++++++++++++++++++++++++++++++++++++++++++++++ 2 linux下LAMP环境搭建 3 ++++++++++++++++++++++++++++++++++++++++++++++ 4 操作系统 : [CentOS6.0] 5 服务器... 阅读全文
posted @ 2015-01-13 10:37 麦田守望者~ 阅读(1179) 评论(0) 推荐(0) 编辑
摘要:1.打开iptables的配置文件:vi /etc/sysconfig/iptables 2.修改vi /etc/sysconfig/iptables命令添加使防火墙开放80端口-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --d... 阅读全文
posted @ 2015-01-12 11:24 麦田守望者~ 阅读(691) 评论(0) 推荐(0) 编辑
摘要:今日编译apache时出错:#./configure --prefix……检查编辑环境时出现:checking for APR... noconfigure: error:APR not found. Please read the documentation解决办法:1.下载所需软件包:wgeth... 阅读全文
posted @ 2015-01-12 10:23 麦田守望者~ 阅读(583) 评论(0) 推荐(0) 编辑
摘要:一:windows下编译Memcached (1)下载地址dll:http://down.51cto.com/data/442606 (2)在php下输出 echo phpinfo();查看php的版本,以及是否 ts/nts vc6/vc9 (3)观察phpinfo中 exte... 阅读全文
posted @ 2015-01-08 15:55 麦田守望者~ 阅读(233) 评论(0) 推荐(0) 编辑
摘要:一:Memcached中的一些参数限制 Key的长度:250字节(二进制协议支持65536个字节) value的限制:1M ,一般都是存储一些文本,如新闻标题等等这个值足够了, 内存的限制:32位下最大设置到2G。 如果有30G数据要缓存一般也会单实列装30G(不把鸡蛋放入到一个篮子... 阅读全文
posted @ 2015-01-08 14:14 麦田守望者~ 阅读(134) 评论(0) 推荐(0) 编辑
摘要:$goods_id = (int)$goods_id; // 先从COOKIE中取出这前浏览过的商品 $goods = cookie('beforeViewGoods'); // 1,2,3,4,5 $goods = explode(',', $goods)... 阅读全文
posted @ 2015-01-08 01:36 麦田守望者~ 阅读(168) 评论(0) 推荐(0) 编辑
摘要:一: linux下编译Memcached(1)先在linux上安装gcc,cmake,autoconf,libtool工具,以后会使用到。 安装命令为:yum install gcc make autoconf libtool 回车 备注:如果不能安装可能是权限问题,那么就全换到超级管... 阅读全文
posted @ 2015-01-07 17:14 麦田守望者~ 阅读(161) 评论(0) 推荐(0) 编辑
摘要:一:Memcached过期机制(1)当某个值过期后,并没有从内存删除,因此stats统计时,curr_item有气信息。(2)如果之前有没有get取其值时,将不会自动删除。当某个新值去占用他的位置的时,就当成chunk来占用(3)当get取其值时,如果过期,返回空,并且清空,所以curr_item就... 阅读全文
posted @ 2015-01-07 16:47 麦田守望者~ 阅读(651) 评论(0) 推荐(0) 编辑
摘要:一:Memcached 内存分布机制 (1)把内存分配成slab 和不同大小的chunk。在跟据键值的大小在选择对应的chunk。这样可以减少最小的内存浪费,内存浪费是不可避免的。[把内存划分成若干个slab仓库,在把每个仓库划分成不同尺寸的小块,需要存内容时,判断内容的大小为其选取合理的仓库。]... 阅读全文
posted @ 2015-01-07 16:07 麦田守望者~ 阅读(125) 评论(0) 推荐(0) 编辑
摘要:1 一:Memcached add 命令参数 2 (1)add key flag expire length [增] 3 key: 键名(起一个独立的名字) 4 flag 标志,要求为一个正整数 5 备注:(1)当Memcached 要存储一个对象和数组的时候,... 阅读全文
posted @ 2015-01-07 15:03 麦田守望者~ 阅读(470) 评论(0) 推荐(0) 编辑
摘要:一:Memcached 介绍(1)官网网址:www.mamcached.org (2) 主要功能是:高性能,分布式的内存对象缓存系统。(3)Nosql不仅仅是关系型数据库,显著特点key value 存储。如 memcached ,redis,或者基于文档存储 如:mongodb。二:Memc... 阅读全文
posted @ 2015-01-06 17:22 麦田守望者~ 阅读(183) 评论(0) 推荐(0) 编辑
摘要:$(window).load(function() { if($(".toursforfun-show").height() > $(".toursforfun-left").height()) { $(".toursforfun-left").scrollFix(-125); } else {... 阅读全文
posted @ 2015-01-06 14:44 麦田守望者~ 阅读(156) 评论(0) 推荐(0) 编辑
摘要:/****字体倾斜***/.telta span{ color: #fff; font-weight: bold; position: absolute; margin-top: -5px; margin-left: -9px; -webkit-transfo... 阅读全文
posted @ 2015-01-05 09:53 麦田守望者~ 阅读(637) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示