在log_config_module的配置中使用%D关键字:
LogFormat “%h %l %u %t %D \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”" combined
日志中就会记录以microseconds(10的-6次方)为单位的处理时间了。
在log_config_module的配置中使用%D关键字:
LogFormat “%h %l %u %t %D \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”" combined
日志中就会记录以microseconds(10的-6次方)为单位的处理时间了。
形如这样的例子:RewriteRule ^/AV$ /index.jsp?ve=3&c=999 [PT,QSA],使用PT作为参数,经测试,rewrite行为并不是一个302。(可以自己用wget -d your url测试)。
apache文档中对这个参数解释如下:
‘passthrough|PT’ (pass through to next handler)
This flag forces the rewriting engine to set the uri field of the internal request_rec structure to the value of the filename field. This flag is just a hack to be able to post-process the output of RewriteRule directives by Alias, ScriptAlias, Redirect, etc. directives from other URI-to-filename translators.
对比测试,如果这样配置:RewriteRule ^/HULUCAT$ http://hulucat.com/ABOUT [R,L],就是302了。
apache:
可以在”server config, virtual host, directory, .htaccess”这些位置加入:
ErrorDocument 404 /404.wml
ErrorDocument 500 /500.wml
tomcat:
在web.xml中加入:
<error-page>
<error-code>404</error-code>
<location>/404.wml</location>
</error-page>
用apache做负载均衡时遇到了如题的错误。
1.去搜索一下,大多数人的解决办法都是提醒添加LoadModule proxy_http_module modules/mod_proxy_http.so,但是我遇到的情况不灵,因为已经添加这个了。
2.参考了一下http://googolflex.com/?p=492这篇文章,找到原因:
ProxyPass / balancer://mycluster/,后面一定要加“/”,而不是ProxyPass / balancer://mycluster
相应修改后重启apache,服务正常。