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]
apache
htaccess redirect only for MSIE 5 and 6 and winxp
.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
默认值是5
对于一个新建连接,内核要发送多少个
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…)