apache分类下的博客

apache log

piaoling  2012-09-24 10:32:46

常用配置 LoadModule log_config_module modules/mod_log_config.so LogLevel warn   <IfModule log_config_module>      LogFormat "%h %l %u %t /"%r/" %>s %b /"%{Referer}i/" /"%{User-Agent}i/" /"%{Cookie}i/""     <FilesMatch "/.(ico|gif|jpg|png|bmp|swf|css|js)">       SetEnv IMAG 1     </FilesMatch>     CustomLog "logs/access_log" combined env=!IMAG </IfModule> Log配置项说明:  %...a:         ......

类别 :  apache(12)  |  浏览(4025)  |  评论(0)

Apache Rewrite实现URL的跳转和域名跳转

piaoling  2012-08-20 00:32:17

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

类别 :  apache(12)  |  浏览(4939)  |  评论(0)

apache rewrite

piaoling  2012-08-20 00:13:07

<IfModule mod_rewrite.c> ############################################ ## enable rewrites     Options +FollowSymLinks     RewriteEngine on #将result?q=**重写到result/index/q/**     RewriteCond %{REQUEST_URI} ^(.*)/result(.*)$     RewriteCond %{QUERY_STRING} ^q=(.*)$       RewriteRule ^(.*)/result(.*)$ http://%{HTTP_HOST}/$1/result/index/q/%1? [R=301,L]     RewriteCond %{THE_REQUEST} ^.*/index.php     RewriteRule ^(.*)index.php$ http://www.domain.com/zh/$1 [R=301,L] &n......

类别 :  apache(12)  |  浏览(4171)  |  评论(0)

Apache VirtualHost

piaoling  2012-07-03 12:05:03

报错信息1: Starting httpd: [Fri May 19 11:49:42 2011] [warn] VirtualHost 127.0.0.1:80 overl aps with VirtualHost 127.0.0.1:80, the first has precedence, perhaps you need a NameVirtualHost directive 这个说明虚拟主机的NAME没开,NameVirtualHost 就是他没开,如下就可以了 #加上这里就好了~~,之后就可加任意多的virtual host了 NameVirtualHost 192.168.8.37:80 # # NOTE: NameVirtualHost cannot be used without a port specifier # (e.g. :80) if mod_ssl is being used, due to the nature of the # SSL protocol. # # # VirtualHost example: # Almo......

类别 :  apache(12)  |  浏览(4676)  |  评论(0)

Apache服务器使用.htaccess实现图片防盗链

piaoling  2011-05-05 14:14:12

所谓盗链,是指其他网站直接链接我们网站上的文件,一般来说,盗链的对象大多为很耗带宽的大体积文件,如图片、视频等。这样造成的后果主要有:增加了服务器的流量负担,影响我们网站的访问速度。 如果你用的是Apache服务器,那么使用.htaccess文件就可以很方便的进行设置,从而防止其他站点的用户盗链我们站点的文件。 Apache中的.htaccess文件 .htaccess文件是Apache中相当重要的配置文件,其格式为纯文本,它提供了针对目录改变配置的方法,通过在一个特定的文档目录中放置一个包含一个或多个指令的文件......

类别 :  apache(12)  |  浏览(3925)  |  评论(0)

Apache重写规则的常见应用及实例说明

piaoling  2011-04-25 17:58:50

本文旨在提供如何用Apache重写规则来解决一些常见的URL重写方法的问题,通过常见的实例给用户一些使用重写规则的基本方法和线索。 一、为什么需要用重写规则 网站的生命在于不断地进行更新和维护,根据业务发展的需求转移服务器进行维护、重新组织目录结构、变换URL甚至改变到新的域名等情况是经常发生的。为了让客户不会因此受到任何影响,最好的方法就是使用Apache Rewrite Rule(重写规则)。 二、重写规则的作用范围 1.使用在Apache主配置文件httpd.......

类别 :  apache(12)  |  浏览(4207)  |  评论(1)

Apache Module mod_rewrite

piaoling  2011-04-25 17:03:34

Summary This module uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly. It supports an unlimited number of rules and an unlimited number of attached rule conditions for each rule, to provide a really flexible and powerful URL manipulation mechanism. The URL manipulations can depend on various tests, of server variables, environment variables, HTTP headers, or time stamps. Even external database lookups in various formats can be used to achieve highly granular URL matching. This module operates on the full URLs (including the path......

类别 :  apache(12)  |  浏览(4449)  |  评论(1)

Apache ReWriteRule参数

piaoling  2011-04-25 15:03:45

作为RewriteRule指令的第三个参数。 Flags是一个包含以逗号分隔的下列标记的列表: 'redirect|R [=code]' (强制重定向 redirect) 以http://thishost[:thisport]/(使新的URL成为一个URI) 为前缀的Substitution可以强制性执行一个外部重定向。 如果code没有指定,则产生一个HTTP响应代码302(临时性移动)。 如果需要使用在300-400范围内的其他响应代码,只需在此指定这个数值即可, 另外,还可以使用下列符号名称之一: temp (默认的), permanent, seeother. 用它可以把规范化的URL反馈给客户端......

类别 :  apache(12)  |  浏览(3928)  |  评论(0)

Apache的RewriteRule规则详细介绍

piaoling  2011-04-25 11:26:33

R[=code](force redirect) 强制外部重定向 (rkyW z 强制在替代字符串加上http://thishost[:thisport]/前缀重定向到外部的URL.如果code不指定,将用缺省的302 HTTP状态码。 gN24M 3{C F(force URL to be forbidden)禁用URL,返回403HTTP状态码。 m> 4ahue$ G(force URL to be gone) 强制URL为GONE,返回410HTTP状态码。 Np'2 }6P P(force proxy) 强制使用代理转发。 ) Ps b>'X L(last rule) 表明当前规则是最后一条规则,停止分析以后规则的重写。 ua 5 O Gx N(next round) 重新从第一条规则开始运行重写过程......

类别 :  apache(12)  |  浏览(3949)  |  评论(1)

RewriteRule example

piaoling  2011-04-25 11:18:46

If http://example.com/foo/bar does not exist, redirect to http://other.example.com/foo/bar. (Put this in an .htaccess file in your top-level web directory.) # .htaccess in root of example.com RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ http://other.example.com/$1 [R] Handle all requests for top-level .html files and files with no extensions (http://example.com/foo, http://example.com/foo.html) with a single PHP program /foo/show.php. Also, ignore trailing characters in set { : ; , . } so URLs like "http://example......

类别 :  apache(12)  |  浏览(4735)  |  评论(0)
  • Page:1/2  12 Blogs
    <<
    >>
    20088
    周日 周一 周二 周三 周四 周五 周六

    文章分类