孤独是一种态度
Web
nginx指定某个文件不能缓存
七 11th
nginx配置了所有图片都缓存,想让某个图盘不被缓存用于监控使用。
一开始指定 expires 为“0“和“-1“都不好用,反回的是403不是200.
添加一个header头为no cache还是不好用,用chrome浏览器还是会显示403。
最后把no cache改为 no-store后正常。
配置为:
location ~* nocache\.jpg$ {
add_header Cache-Control no-store;
}
原创文章,转载请注明: 转载自gjw_apparitor 博客
本文链接地址: nginx指定某个文件不能缓存
非常好的页面速度分析工具 Page Speed
五 17th
Page Speed 是 Google Chrome 用来网页速度测试工具 ,不过由于使用了实验性的API,所以该扩展只在Google Code提供下载测试。
URL:http://code.google.com/intl/zh-CN/speed/page-speed/docs/using_chrome.html
按照上边的步骤去安装 Page Speed
最后测试了一下公司的主页
Page Speed Score: 68/100
叫我情何以堪!
原创文章,转载请注明: 转载自gjw_apparitor 博客
本文链接地址: 非常好的页面速度分析工具 Page Speed
apache 配置SSI
四 6th
在apache的 httpd.conf中
去消掉前边的注释
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml .html
Options Indexes FollowSymLinks Includes
AllowOverride None
Order allow,deny
Allow from all
在Directory里添加 Options Indexes FollowSymLinks Includes
原创文章,转载请注明: 转载自gjw_apparitor 博客
本文链接地址: apache 配置SSI
Nginx + pcre + zlib
四 6th
prce
http://www.pcre.org/
# wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.9.tar.gz # tar zxvf pcre-7.9.tar.gz # cd pcre-7.9 # ./configure # make && make install
zlib
http://www.zlib.net/
# wget http://www.gzip.org/zlib/zlib-1.2.3.tar.gz # tar zxvf zlib-1.2.3.tar.gz # cd zlib-1.2.3 # ./configure # make && make install # mkdir /usr/include/pcre/ # cp /usr/local/lib/libpcre.a /usr/include/pcre/libpcre.a # cp /usr/local/lib/libpcre.a /usr/include/pcre/libpcre.la # cp /root/pcre-7.9/pcre.h /usr/include/pcre/pcre.h # mkdir /usr/include/pcre/.libs # cp /usr/local/lib/libpcre.a /usr/include/pcre/.libs/libpcre.a # cp /usr/local/lib/libpcre.a /usr/include/pcre/.libs/libpcre.la # cp /root/pcre-7.9/pcre.h /usr/include/pcre/.libs/pcre.h
Nginx
http://nginx.net/
# http://sysoev.ru/nginx/nginx-0.7.62.tar.gz # tar zxvf nginx-0.7.62.tar.gz # cd /nginx-0.7.62 #./configure --prefix=/data_web/nginx-0.7.62/ \ --with-http_stub_status_module \ --with-http_gzip_static_module vi objs/Makefile 删除“./configure –disable-shared”行 # make && make install
原创文章,转载请注明: 转载自gjw_apparitor 博客
本文链接地址: Nginx + pcre + zlib
apache worker模式
四 6th
ServerLimit 50 apache 进程数上限
ThreadLimit 110 apache 线程数上限
StartServers 5 apache 启动时默认建立的进程数
MaxClients 5000 最大并发数
MinSpareThreads 25 最小线程空闲数
MaxSpareThreads 200 最大线程空闲数
ThreadsPerChild 100 每个进程最多开启的线程
MaxRequestsPerChild 5000 指令用于控制服务器建立新进程和结束旧进程的频率
MaxRequestsPerChild 等于 MaxSpareThreads 或者 等于0 没有限制 最好不要设置为0防止内存溢出把服务拖死。
ServerLimit 大于 MaxClients/ThreadsPerChild
ThreadLimit 大于 MaxClients/ServerLimit
MaxSpareThreads 大于 ThreadsPerChild
原创文章,转载请注明: 转载自gjw_apparitor 博客
本文链接地址: apache worker模式
解决 Nginx处理404的SSI页面跳转的问题。
四 6th
如果你的页面里SSI文件是用 “include virtual=”着种方式嵌套进去的。
你又配置了,错误页面跳转。
error_page 404 404.html
当你嵌套的页面不存在的时候就会发生整个页面变成404跳到404.html下了。
我们着一个技术很牛的同事想到的。
解决:
再域名的根目录创建个文本文件,里边的内容随意。我的是:
echo ‘‘ > ssi_404.txt
再nginx的配置文件里加上:
location ~* \.shtml$ {
error_page 404 ssi_404.txt;
}
这样有404的ssi页面就会显示这个内容,从而不会跳到404.html去了。
原创文章,转载请注明: 转载自gjw_apparitor 博客
本文链接地址: 解决 Nginx处理404的SSI页面跳转的问题。