apache

htaccess redirect only for MSIE 5 and 6 and winxp

RewriteEngine on
#
# Redirect IE 5 and IE 6 requests to version-specific subdomains
RewriteCond %{HTTP_USER_AGENT} MSIE\ ([56])\. [OR]
RewriteCond %{HTTP_USER_AGENT} Windows\ NT\ 5\.1
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=302,L]


.htaccess RewriteRule详解

1、Rewrite规则简介:

Rewirte 主要的功能就是实现URL的跳转,它的正则表达式是基于Perl语言。可基于服务器级的(httpd.conf)和目录级的(.htaccess)两种方 式。如果要想用到rewrite模块,必须先安装或加载rewrite模块。方法有两种一种是编译apache的时候就直接安装rewrite模块,别一 种是编译apache时以DSO模式安装apache,然后再利用源码和apxs来安装rewrite模块。 (continue reading…)


Apache SSL in htaccess examples

Apache SSL examples in htaccess files

Any htaccess rewrite examples should always begin with

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

Fixing double-login problem and making sure authorization usernames/passwords are not sent in cleartext unencrypted. (continue reading…)


Htaccess文件用法集锦

1.时区设置

有些时候,当你在PHP里使用date或mktime函数时,由于时区的不同,它会显示出一些很奇怪的信息。下面是解决这个问题的方法之一。就是设置你的服务器的时区。你可以在这里找到所有支持的时区的清单。 (continue reading…)


1个IPn个域名n个证书

mod_gnutls使用GnuTLS库提供给Apache SSL 3.0和TLS1.x的协议。除了标准的X.509证书认证,它提供了支持SRP和OpenPGP金钥验证密码的身份验证. (continue reading…)


proc/sys/net/ipv4/下各项的意义

tcp_syn_retries :INTEGER
默认值是5
对于一个新建连接,内核要发送多少个 SYN 连接请求才决定放弃。不应该大于255,默认值是5,对 应于180秒左右时间。(对于大负载而物理通信良好的网络而言,这个值偏高,可 修改为2.这个值仅仅是针对对外的连接,对进来的连接,是由tcp_retries1 决定的) (continue reading…)


PHP-CGI 进程 CPU 100% 与 file_get_contents 函数的关系

有时候,运行 Nginx、PHP-CGI(php-fpm) Web服务的 Linux 服务器,突然系统负载上升,使用 top 命令查看,很多 php-cgi 进程 CPU 使用率接近100%。后来,我通过跟踪发现,这类情况的出现,跟 PHP 的 file_get_contents() 函数有着密切的关系。 (continue reading…)


ab Connection reset by peer (104)

Try this :

echo “10240” > /proc/sys/net/core/somaxconn

or set (to make permanent)

net.core.somaxconn = 10240 (or any number over what you are using as max connections)

in

/etc/sysctl.conf

then run

/sbin/sysctl -p /etc/sysctl.conf

Also set your local ulimit to

ulimit -n 65535

just to have some overhead in case you want to increase the concurrent connections in ab. Let me know if that helps. If you want my thoughts on why I think this fixes things (assuming it helps you) let me know

Also if you move to Worker MPM (you will have to redo php to be threadsafe if you use php) it might lower you CPU usage for a higher RAM usage depending on what your running off your server.


查看Apache并发请求数及其TCP连接状态

这两天搭建了一组Apache服务器,每台服务器4G内存,采用的是prefork模式,一开始设置的连接数太少了,需要较长的时间去响应用户的请求,后来修改了一下Apache 2.0.59的配置文件httpd.conf: (continue reading…)


大量LAST_ACK 分析过程

分析的很仔细,并且我在实际中用到了~ 转过来保留 (continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress