Apache Note | Apache Learning Notes (Experienced) by Emerald Green College - Green Institute

xiaoxiao2021-03-06  42

# Apache Note | Apache Learning Notes (Experience) by Emerald Green College - Green Institute # 02. Virtual Host # 03.log # 06. # 05.log # 06. URL REWRITE # 07. Others ######## 01. General Settings # listen # Listening Port, Example: Listen 80 # ServerRoot # Apache Sitting, Example: ServerRoot "C: / Program Files / Apache Group / Apache2" (Windows) # serveradmin # Error report email, example: serveradmin btbtd@yahoo.com.cn # Document # Site root directory, example: DocumentRoot "i: / gi-2288" # DirectoryIndex # Configure directory index file, # example: DirectoryIndex Index.php index.php3 index.html index.htm # servername # server domain name / IP address, example: ServerName Gi.2288.org # defaultLanguage # Set a specific default language for all files within the range of privileges # Syntax: DefaultLanguage Mime-Lang, Example: DefaultLanguage EN-CN # AddDefaultCharSet # During the response, the default character set to the response, the default value: adddefaultcharset off # example: adddefaultcharset UTF-8, Syntax: Syntax: ADDDEFAULTCHARSET ON | OFF | Character Set # AddHandler #012702: addHandler CGI-script .cgi .pl # Syntax: AddHandler Handler-Name Extension # accessFileName # Define Profiles, Example: AccessFileName .htaccess # When the document is returned to the client, if this is set Record the publishing configuration file function. # The server will find the first existing profile from the list of each path in this document. # Timeout # Timeout, Example: Timeout 300 # typesconfig # Specify the location of the mime.types file, the default: TypeSconfig conf / mime.types # defaulttype # defaulttype mime type, # sometimes happens: The server will be asked to provide one Documentation, and this document is not determined by its MIME type mapping. # The server must inform the client's content type of the document. # So when an unknown type occurs, defaultType will be used. # 例: defaulttype image / gif # hostnamelookups # Enable DNS Find to Client IP, Syntax: Hostnamelookups on | Off | Double # ErrorLog # Location Server Store Error Log Location, Example: ErrorLog "G: / Apache / Dummy-Gi .2288.org.80-error_log "# loglevel # Control the level of error logs, default: loglevel warn # Emerg Emergency - The system cannot be used. # Alert must take immediate action. # crit fatal situation. # Error error condition. # WARN Warning situation. # NOTICE is generally important. # info ordinary information.

# debug error level information # CustomLog # Set the file name and format of the log, default: CustomLog logs / access.log Common # ServerToKens # Configure the server HTTP response head, default: ServerToKens Full # ServerToKens Prod [UCTOONLY], the server will send (such as Say): Server: Apache # ServerToKens Major, the server will send (such as): Server: Apache / 2 # ServerToKens Minor, the server will send (for example): Server: Apache / 2.0 # serverToKens min [iMal], server will send (For example): Server: Apache / 2.0.41 # ServerToKens OS, the server will send (for example): Server: Apache / 2.0.41 (unix) # serverToKens Full (or not specified), # server will send (for example : Server: Apache / 2.0.41 (UNIX) PHP / 4.2.2 MYMOD / 1.2 # maxSpareServers # Set Apache's Maximum Idle Process Count # Syntax: MaxSpareServers Number # Default: MaxSpareServers 100 # case: maxSpareServers 1000 # MaxkeepAliveRequests # settings Maximum number of requests # Syntax: MaxkeepaliveRequests Number # Default: MaxkeepaliveRequests 100 # ServerSignature # Configure the footer of the server generated page, Default: Serversignature ON | Off | Email # App: # listen 80 # ServerRoot "C: / Program Files / Apache Group / Apache2" # serveradmin btbtd@yahoo.com.cn # DocumentRoot "i: / gi-2288" # DirectoryIndex index.php index.php 3 index.html index.htm # ServerName gi.2288.org # DefaultLanguage zh-CN # AddDefaultCharset utf-8 # AddDefaultCharset Off # AddHandler cgi-script .cgi .pl # AccessFileName .htaccess # Timeout 300 # TypesConfig conf / mime.types # R1-gi.2288.org.80-rror_log "# Loglevel Warn # Customlog logs / access.log common # ServerToKens Prod [uctonly] # serversignature off ######## 02. Virtual host # listen 80 # Set listener port # Namevirtualhost 192.168.1.2:80 # Name / port type virtual host # # # Virtual host segment # serveradmin btbtd @

Yahoo.com.cn # Contact Management Box # DocumentRoot "I: / GI-2288" # Site root directory # servername gi.2288.org # domain name # irelog "g: /apache/dummy-gi.2288.org .80-error_log "# Error log # logging is a good thing, pay attention to check the log record # ------------ or more is the virtual host content # 完用 应用用: # listen 80 # NamevirtualHost 192.168.1.2: 80 # # serveradmin btbtd@yahoo.com.cn # DocumentRoot "i: / gi-2288" # servername gi.2288.org # ######## 03. < Directory> Alias ​​# Syntax: ... #Paches a set of instructions that only works on file system directories and their subdirectories with a name. # 不 允 目 目# Allow directory browsing, Example: # alias / document "j: / document /" # "> # Options indexes # allowoverride none # Order Allow, Deny # allow from all # # Allow & Deny # allows or reject access from a particular hostname or host address, and the ORDER directive tells Apache to process the order of the two instructions to change the filter.

# Allow # Allow all addresses, examples: Allow from all # Only allows specific IP addresses to access directory, for example: Allow from 205.252.46.165 # Only a specific domain name address access directory, example: Allow from www.google.com # only Allow specific IP segment access, Example: Allow from 10.10.0.0/255.255.0.0 # de Neny # Rejects all address access directories, examples: Deny from all # Reject specific domain name access directory, example: deny from www.google.com # Reject specific IP Access Directory, Example: Deny from 218.15.84.152 # Reject an IP segment access directory, example: deny from 10.10.0.0/255.255.0.0 # allow & deny mixing # Reject access to all addresses, but accept Google access, Example: # # Options Followsymlinks # Order Deny, Allow # deny from all # allow from www.google.com # # Accept all addresses access, but reject Google's access , Example: # # Options Followsymlinks # order deny, allow # deny from www.google.com # allow from all # # Options # Syntax: Options [ ] Options [[ | -] Options] ... # Configure which features used in a specific directory, the # Options directive controls which server features will be used in a specific directory. # Options can be set to None, in which case any additional characteristics will not be enabled. # Or set one or more of the following options: # all, in addition to all features other than MultiViews. This is the default setting. # Execcgi, allowing CGI scripts. # FollowSymlinks, the server will use symbolic connections in this directory. # Note: Even if the server uses a symbol connection, it does not change the path name used to match the configuration segment. # Note: If this configuration is in the configuration segment, this setting will be ignored. # Includes, allowing the server to be included. # Includesnoexec, allowing the server to include, but disable #exec commands and #exec CGI. #, You can still use the #include virtual CGI script from the Scriptaliase directory. # Indexes, if a URL mapped to the directory is requested, # and there is no DirectoryIndex in this directory (for example, index.html.zh-cn.gb2312), #Wey the server returns a list of formatted directories. # MultiViews, allowing the content to negotiate multiple attention. # Symlinksifownermatch, the server uses only when the symbol connection is the same user ID with its destination directory or file owner. # Note: If this configuration appears in the configuration segment, this option will be ignored. # Allowoverride # Syntax: ALLOWOVERRIDE All | None | Instruction Types [Instruction Type] ... # Description: Allows the instruction type in the .htaccess file # When the server discovers a .htaccess file (specified by accessFileName), # it Need to know which instructions declared in this file can override the access information specified before this.

# Allowoverride is only valid in section. It is invalid in or . # If this command is set to None, the .htaccess file will be completely ignored. # In this case, the server does not even try to read the .htaccess file from the file system. # When this instruction is set to all, all instructions with .htaccess context allow the appearance in the .htaccess file. ######## 4. .Htaccess # Tip: Allow use .htaccess file will result in a decline in server performance. # In addition, you need to read the .htaccess file each time you ask a page. # Open .htaccess Support Must This must be set to set this allowoverride all, for example: # alias / v "j: / pwd /" # # Options indexes # allowoverride all # Order Allow, Deny # allow from all # # If some sensitive information on the network site or only want to be accessed for a small group, # Here you introduce several methods to ensure that users can only access the resources allowed to be accessed. #Thudiki, or a configuration file (.htaccess Files) for a single directory, in the segment. # If you want to use the .htaccess file, you must set the server to allow the authentication instructions to be used in these files, and specify which instructions are valid in the configuration file for a single directory in these files. # Use a password to protect the directory on the server, first requiring a password file. # This file can be placed in a location that cannot be accessed by the network to avoid being downloaded, # for example: g: / apache can not be accessed by the network, #We can consider putting the password file in the G: / Apached directory.

# Apache offers a tool called htpasswd in the bin sub-directory of its installation directory, # to create a password file, you can use: # (first switch to the Apache installation directory, example: c: / program files / apache group / apache2 / BIN) # Enter: htpasswd -c g: / apache / passwords e # (This creates a user E # (this is required to set the user and password according to yourself) #, then you will ask you to enter your password, then enter once again, Test password. # This in g: / apache / more passwords files (no suffix name) # Windows, use the MD5 encrypted password with MD5. # And then build a .htaccess file in the directory to set the permission, # .htaccess The contents of the file are: # authtype Basic # authname "restricted file" # authUserfile g: / apache / passwords # Require user e # presentation page: http://gi.2288.org:88/v # User: E Code: TestHtpasswd # Note: The directory must allow AllowOverride all, so.htaccess file can take effect. ######## 5. Log # apache's log file can provide a lot of information, it is necessary to understand these logs # C: / Program Files / Apache Group / Apache2 / Logs (log file storage in Windows) # access.log (access log, understand the content of the client access) & error.log (Error Log) # Custom Log Format # mod_log_config # status : Base # Description: Record to the server to the server to log # Default: CustomLog logs / access.log Common # Recommended setting: # Customlog logs / access_log "% H% L% U% T"% R "% S% B "% {Referer} i" "# logformat # default: logformat"% h% L% u% T / "% r /"%> s% B "# 语法: logformat form AT | Nickname [Nickname] # Description: Defines the record format in the log file # example: logformat "% V% H% L% U% T /"% r / "%> S% B" vhost_common # CustomLog # status: base: base: Base # 语法: CustomLog File | Pipe Format | Nickname [ENV = [!] Environment-variable] # Description: Set the file name and format # example: Customlog logs / access_log "% H% L% U% T /"% R / "%> s% b" # ERRORLOG # Syntax: ERRORLOG file path | syslog [: facility] # Default: errorlog logs / error_log (unix) errorlog logs / error.log (windows and os / 2) # Description: Location The server stores the position of the error log. # 例: ErrorLog "g: /apache/dummy-gi.2288.org.88-error_log"

# Cookielog # Syntax: cookielog filename # Description: Set the log file name to cookies # "/us/local/var/apache/logs/rewrite.log" (Unix / Linux) # REWRITELOG "g: /apache/rewrite.log" (Windows) # Some common format strings are as follows: # 能 日 日Format (CLF): "% H% L% U% T /"% R / "%> S% B" # Universal log format with virtual host: "% V% h% L% u% T /"% r / "%> S% B" # ncsa extended / combined log format: "% h% L% u% T /"% r / "%> S% b /"% {referer} I / "/"% {user -Agent} i / "# referer log format:"% {referer} i ->% u "# agent (browser) log format:"% {user-agent} I "######## 6. URL REWRITE # Note: Depending on your server configuration, it may be necessary to do some micro modifications to the example. . # To a specific rule set should first understand and then use it to avoid problems.

# 重写 语法 # REWRITEENGINE ON # REWRITERULE ^ / $ / WWW / [R] # General Rewriting Method # Override page: http://gi.2288.org: 88 / Modules / News / INDEX.PHP # REWRITERULE / Modules / news / index.htm $ /Modules/news/index.php # Complete page: http://gi.2288.org:88/modules/news/index.htm # Override page: http: // gi. 2288.org:88/modules/news/index.php?storytopic=2 # REWRITERULE /MODULES/NEWS/Topic_ (.* )/.htm @ /modules/news/index.php?storytopic= $ 1 # Complete Page: http : //gi.2288.org: 88 / modules / news / topic_2.htm # Overridden page: http://gi.2288.org: 88 / index.php? storytopic = 2start = 10 # REWRITERULE / TOPIC. *) - (. *) /. htm $ /dex.php?storytopic= $1&Start= $2 # Complete page: http://gi.2288.org:88/topic2-2.htm # Note: Each additional weight Write ID, you must be accumulated $ 1 # such as page: http://gi.2288.org:88/CT=2X=10Y=20 # can be rewritten like this: # REWRITERULE / CT (. *) - (. *) - ( * /. htm $ / ct = $ 1X = $ 2Y = $ 3 # Effects: http://gi.2288.org:88/ct2-10-20.htm # mobile host directory to different website server # Description : # Typically, many network management will have this requirement when establishing a new website server: # 重 重 向 目 目 目 目 目 目 目 服务 目 目 目 方案 目 目 向 向 向 向 服务 服务 方案 方案 方案 方案 方案 方案 方案 方案Redirect all URL # / ~ user / anypath to http: // newserver / ~ user / annpath on old website servers. # REWRITEENGINE ON # REWRITERULE ^ / ~ (. ) Http: // newserver / ~ $ 1 [r, l] # Depends on the content of the browser # Description: # At least an important top page, sometimes it is necessary to provide dependency The best content of the browser, # is the maximum version of the latest Netscape, providing the minimized version of Lynx, # and provides a feature-made version of other browsers. # 方案: # In this, content negotiation is powerless, because the browser does not provide its form of type, and then only thinks on the HTTP header "User-agent".

# The following rule set can accomplish this: # If the http header "user-agent" starts with "mozilla / 3", the page foo.html is rewritten to foo.ns.html, and then the overwriting operation is terminated; "Lynx" or version of "Mozilla" in 1 and 2, then rewritten as foo.20.html; # and all other browsers received by foo.32.html: # shutritecond% {http_user_agent } ^ Mozilla / 3. * # REWRITERULE ^ foo / .html $ foo.ns [l] # REWRITECOND% {http_user_agent} ^ Lynx /.* [or] # REWRITECOND% {http_user_agent} ^ mozilla / [12]. * # Rewriterule ^ Foo / $ 5 [L] # REWRITERULE ^ Foo / $ foo.32 [l] # Block Robots # Description: # How to prevent a completely anonymous Robot from getting a specific network area page? # A / Robots.txt file can contain rows of "Robot Exclusion Protocol", # but not enough to prevent such Robot. # Program: # You can use a rule set to refuse to access the network zone / ~ quux / foo / arc / # (list of a very deep directory area) to enable the server to generate a large load). # 还 还 还 阻 阻,,,,,,,,.., 不, 不 不 不 不 不 不.. 不 不 不 不 不 不. 不....... To this end, you need to match the User-Agent information of the HTTP header. # REWRITECOND% {http_user_Agent} ^ nameofbadrobot. * # REWRITECOND% {remote_addr} ^ 123 / .45 / .67 /. [8-9] $ # REWRITERULE ^ / ~ Quux / foo / arc /. - [f] # Preventive Chain Picture # Description: # 假 假, http://gi.2288.org: 88 / myalbum / There are some embedded pictures, # These pictures are very good, so someone uses a super chain to their own page bingo. # Because this is discontinued in the traffic, we are not willing to happen this kind of thing. # 方案: # Although we cannot protect these pictures without being written to other people's pages, #, at least you can limit the browser that issues an HTTP Referer header.

# REWRIERER}! ^ $ # REWRIERER}! ^ Http_referer}! ^ Http: //gi.2288.org: 88 / myalbum /.* $ [nc] # REWRITERULE. * /. GIF $ - [f] # Rewritecond% {http_refere}! ^ $ # REWRIERER}!. * / Foo-with-gif / .html $ # REWRITERULE ^ Inlined-in-foo / .gif $ - [f] ####### # 7. Other # 禁 禁 # # setenvifnocase referer "^ http: //gi.2288.org: 88 /" local_ref = 1 # # Order allow, deny # allow from env = local_ref # # loading php 5 # loadModule php5_module c: /php/php5apache2.dll # #addmodule mod_php4.c # addType Application / X-httpd- PHP .php # Scriptalias / PHP / "C: / PHP /" # addtype application / x-httpd-php .php # action application / x-httpd-php "/php/php-cgi.exe" # running Apache for Windows # You can install Apache as Windows NT services like this: Apache -i -n "service name" # To install a service using a specific configuration, specify the configuration file when installing: # apache -i -n service "-F" / my server / conf / my.conf "# To remove an Apache service, use: Apache -u -n" service name "# Note: If there is no service name, default, will be used ". # Once the service is installed, you can use the -n option and other options to access the service configuration file.

# For example: Test a service configuration file: Apache -n "service name" -t # boot a console Apache: Apache -n "service name" # control service method Apache # boot, restart and Close / Stop Apache Service: # Apache -n "Service Name" -k Start # apache -n "service name" -k limited "service name" -k shutdown # apache -n "service name" -k stop # Or use the NT native command NET to start and stop Apache service, like this: # net start "service name" # net stop "service name" # 本 服务 发现 问题 问题 或 或 如 如 修 修 修 修 修The original address. - by Emerald 2005-2-15 # / ************************************************ *************************** / # * # * author: Emerald # * # * HomePage: http://gi.2288.org:88/ # * # * SEO-GI: http:99 # * # * SiteName: Green College - Green Institute # * # * DATE: 2005- 2-15 2:03:35 # * # / ******************************************************** *********************************** / TXT file: # apache note | apache learning notes (experienced) by Emerald Green College - Green Institute

# Category:

# 01. General settings

# 02. Virtual host

# 03. Alias

# 04..htaccess

# 05.log

# 06.url Rewrite

# 07. Others

######## 01. General setting

# Listen

# 监 监 端,, example: Listen 80

# ServerRoot

# Apache The directory, example: ServerRoot "C: / Program Files / Apache Group / Apache2" (WINDOWS)

# ServerAdmin

# 错误 报 邮 邮箱, example: serveradmin btbtd@yahoo.com.cn

# DocumentRoot

# 地点 根 目, example: DocumentRoot "i: / gi-2288"

# DirectoryIndex

# Configure the directory index file,

# 例: DirectoryIndex index.php index.php3 index.html index.htm

# Servername

# Server Domain Name / IP Address, Example: ServerName Gi.2288.org

# Defaultlanguage

# Set a particular default language for files within the range of all instructions.

# 语法: DefaultLanguage Mime-lang, Example: DefaultLanguage EN-CN

# AddDefaultcharset

# The default character set added to the response in the case where the specified character set is not specified, the default value: AddDefaultCharset Off

# 多:: AddDefaultcharset UTF-8, Syntax: Syntax: AddDefaultcharset On | Off | Character Set

# AddHandler

#Seand mapping between file extensions and specific processors, examples: AddHandler CGI-script .cgi .pl # Syntax: AddHandler Handler-Name Extension

# AccessFileName

# Define Profile, Example: AccessFileName .htaccess

# When you return a document to the client, if you set the publishing configuration file function for this directory.

# The server will find the first existing profile from the list of each path in this document.

# Timeout

# Timeout, example: Timeout 300

# Typesconfig

# Specify the location of the mime.types file, default: TypeSconfig conf / mime.types

# DefaultType

# DefaultType Mime type,

# Sometimes this happens: The server will be asked to provide a document, and the type of this document cannot be determined by its MIME type mapping.

# The server must inform the client's content type of the document.

# So when an unknown type occurs, defaultType will be used.

# 例:: defaulttype image / gif

# Hostnamelookups

# Enable DNS lookup to client IP, syntax: Hostnamelookups on | Off | Double

# Irelog

#Local server storage error log location, example: ErrorLog "g: /apache/dummy-gi.2288.org.80-error_log"

# Loglevel

# Control the level of the error log, the default value: Loglevel Warn

# Emerg Emergency - The system cannot be used.

# Alert must take immediate action.

# crit fatal situation.

# Error error condition.

# WARN Warning situation.

# NOTICE is generally important.

# info ordinary information.

# debug error level information

# Customlog

# Set the file name and format of the log, default: Customlog logs / access.log Common

# ServerToKens

# Configure the server http response header, default: ServerToKens Full

# ServerToKens Prod [UcTonly], the server will send (for example): Server: Apache

# ServerToKens Major, the server will send (such as): Server: Apache / 2

# ServerToKens Minor, the server will send (for example): Server: Apache / 2.0

# ServerToKens Min [IMAL], the server will send (for example): Server: apache / 2.0.41

# ServerToKens OS, the server will send (for example): Server: Apache / 2.0.41 (UNIX)

# ServerToKens Full (or Not Specified),

# The server will send (for example): Server: Apache / 2.0.41 (UNIX) php / 4.2.2 mymod / 1.2

#Maxspareservers

# Set the maximum number of free processes for Apache

# 语法: MaxSpareServers Number

# Default: maxSpareServers 100

# 例:: MaxSpareServers 1000

# MaxkeepaliveRequests

# Set the maximum number of requests for each connection

# 语法: MaxkeepaliveRequests Number

# Default: MaxkeepaliveRequests 100

# Serversignature # Configure the footer of the server generated page, the default value: ServersignaRe OFF

# 语法: Serversignature ON | Off | Email

# Application:

# Listen 80

# ServerRoot "C: / Program Files / Apache Group / Apache2"

# ServerAdmin btbtd@yahoo.com.cn

# DocumentRoot "I: / GI-2288"

# DirectoryIndex index.php index.php3 index.html index.htm

# ServerName Gi.2288.org

# DefaultLanguage EN-CN

# AddDefaultCharset UTF-8

# AddDefaultCharset Off

# AddHandler CGI-script .cgi .pl

# AccessFileName .htaccess

# TIMEOUT 300

# Typesconfig conf / mime.types

# RRLOG "g: /apache/dummy-gi.2288.org.80-error_log"

# Loglevel Warn

# Customlog Logs / Access.log Common

# ServerToKens PROD [UCTONLY]

# Serversignature Off

######## 02. Virtual host

# Listen 80

# Set the listening port

# NamevirtualHost 192.168.1.2:80

# 名字 / port type virtual host

#

#

# 虚 虚 主机

# ServerAdmin btbtd@yahoo.com.cn

# Contact management to use mailboxes

# DocumentRoot "I: / GI-2288"

# 站点 根 目

# ServerName Gi.2288.org

# Domain name

# RRLOG "g: /apache/dummy-gi.2288.org.80-error_log"

# 错误 log # logging is a good thing, pay attention to view logging

# ------------ or more is the virtual host content

# 全 应用:

# Listen 80

# NamevirtualHost 192.168.1.2:80

#

# ServerAdmin btbtd@yahoo.com.cn

# DocumentRoot "I: / GI-2288"

# ServerName Gi.2288.org

#

######## 03. Alias

# 语法: ...

# Package a set of instructions that only works on file system directories with a name and its subdirectories.

# Do not allow directory browsing, examples:

# Alias ​​/ document "j: / document /"

#

# Options Followsymlinks

# Allowoverride none

# Order allow, deny

# Allow from all

#

# Allow directory browsing, examples:

# Alias ​​/ document "j: / document /"

#

#Boptions indexes

# Allowoverride none

# Order allow, deny

# Allow from all

#

# Allow & den

# Allow and DENY instructions allow or reject access from a particular hostname or host address,

# At the same time, the ORDER directive tells Apache to process the order of these two instructions to change the filter.

# Allow

# Allow access to all addresses, Example: Allow from ALL

# Only allow specific IP addresses to access directory, example: Allow from 205.252.46.165

# Only a specific domain name address access directory, example: Allow from www.igoogle.com

# Only a specific IP segment is allowed to access, an example: Allow from 10.10.10.0/255.255.0.0

# Deny

# Reject all address access directories, examples: Deny from ALL

# Reject specific domain name access directory, Example: Deny from www.igoogle.com

# Reject a specific IP access directory, example: Deny from 218.15.84.152

# Reject an IP segment access directory, example: deny from 10.10.10.0/255.255.0.0

# Allow & deneny mix

# Reject access to all addresses, but accept Google's access, for example:

#

# Options Followsymlinks

# Order deny, allow

# Deny from all

# Allow from www.google.com

#

# Accept access to all addresses, but reject Google's access,

#

# Options Followsymlinks

# Order deny, allow

# Deny from www.google.com

# Allow from all

#

#Boptions

# 语法: Options [ |] Options [[ | -] Options] ...

# What features are configured in a specific directory,

# OPTIONS instructions Control which server features will be used in a specific directory.

# Options can be set to None, in which case any additional characteristics will not be enabled.

# Or set one or more of the following options:

# All, in addition to all features other than MultiViews. This is the default setting.

# Execcgi, allowing the CGI script to be performed.

# FOLLOWSYMLINKS, the server will use symbolic connections in this directory.

# Note: Even if the server uses a symbol connection, it does not change the path name used to match the configuration segment.

# Note: If this configuration is in the configuration segment, this setting will be ignored.

# Includes, allowing the server to be included.

# Includesnoexec, allowing the server to include, but disable #exec commands and #exec CGI.

#, You can still use the #include virtual CGI script from the Scriptaliase directory.

# Indexes, if a URL mapped to the directory is requested,

# And this directory has no DirectoryIndex (for example: index.html.zh-cn.gb2312), #Wey the server returns a list of formatted directories.

# MultiViews, allowing the content to negotiate multiple attention.

# Symlinksifownermatch, the server uses only when the symbol connection is the same user ID with its destination directory or file owner.

# Note: If this configuration appears in the configuration segment, this option will be ignored.

# Allowoverride

# 语法: Allowoverride All | None | Instruction Type [Instruction Type] ...

# Description: Allows the type of instructions in the .htaccess file

# When the server discovers a .htaccess file (specified by AccessFileName),

# It needs to know which instructions declared in this file can override the access information specified before this.

# Allowoverride is only valid in section. It is invalid in or .

# If this command is set to None, the .htaccess file will be completely ignored.

# In this case, the server does not even try to read the .htaccess file from the file system.

# When this instruction is set to all, all instructions with .htaccess context allow the appearance in the .htaccess file.

######## 4 .htaccess

# 提:: Allow use.htaccess file will result in a decline in server performance.

# In addition, you need to read the .htaccess file each time you ask a page.

# Open .htaccess Support must set up allowoverride all, for example:

# Alias ​​/ v "j: / pwd /"

#

#Boptions indexes

# Allowoverride all

# Order allow, deny

# Allow from all

#

# If some sensitive information on the network site or only want to be accessed for a small group,

# Here you introduce several methods to ensure that users can only access resources allowed to be accessed.

#Thudiki, or a configuration file (.htaccess Files) for a single directory.

# If you want to use the .htaccess file, you must set the server to allow the authentication instruction to be used in these files.

# 即, specify which instructions are valid in the configuration file for a single directory with the AllowOverride instruction.

# Use a password to protect the directory on the server, first requiring a password file.

# This file can be placed in the location that cannot be accessed by the network to avoid being downloaded,

# For example: g: / apache, can not be accessed by the network,

# So you can consider putting your password file in the g: / apached directory.

# Apache provides tools called htpasswd in the bin sub-directory of its installation directory.

# To create a password file, you can use this:

# (First switch to the Apache installation directory, example: c: / program files / apache group / apache2 / bin)

# Enter: htpasswd -c g: / apache / passwords e in command line: htpasswd -c g: / apache / passwords e

# (This creates a user E, specifically set the user and password to yourself)

# Next, you will ask you to enter your password, then enter once, check your password.

# This in g: / apache / more passwords files (no suffix name)

# # W 下 下 加 加 加 加 加 加..

# And then build a .htaccess file in the directory to set the permissions, # .htaccess file is:

# Authtype Basic

# Authname "Restricted Files"

# Authorserfile G: / Apache / Passwords

# Require User E

# 演 演 页: http://gi.2288.org:88/V

# 用户 用户: E Password: TestHtpasswd

# Note: The directory must allow Allowoverride All, so.htaccess file can take effect.

######## 5. Log

# Apache's log file can provide a lot of information, it is necessary to understand these logs

# C: / program files / apache group / apache2 / logs (log file storage in Windows)

# Access.log (access log, understand the content of the client access) & error.log (error log)

# Custom log format

# MOD_LOG_CONFIG

# Status: Base

# Description: Record the request to the server to the log

# Default: Customlog logs / Access.log Common

# Recommended setting:

# Customlog logs / access_log "% H% L% u% T"% r "% s% b"% {referer} i ""% {user-agent} i ""

# Logformat

# Default: logformat "% H% L% u% T /"% r / "%> s% B"

# 语法: Logformat Format | Nickname [Nickname]

# Description: Define the record format in the log file

# 例: logformat "% V% h% L% u% T /"% r / "%> s% B" vhost_common

# Customlog

# Status: Base

# 语 法: Customlog file | Pipe format | Nickname [env = [!] Environment-variable]

# 说明 说明: Set the file name and format of the log

# 例: Customlog logs / access_log "% h% L% u% T /"% r / "%> s% B"

# Irelog

# 语法: ERRORLOG File Path | syslog [: facility]

# Default: Errorlog logs / error_log (unix) errorlog logs / error.log (Windows and OS / 2)

# Description: Location server stores the location of the error log

# 例: ErrorLog "g: /apache/dummy-gi.2288.org.88-error_log"

# Cookielog

# 语法: cookielog filename

# Description: Set the log file name for cookies

# Module: MOD_LOG_CONFIG

# REWRITELOG

# 语法: Rewritelog file-path

# Description: Set the file name of the rewrite engine log

# Module: MOD_REWRITE

# 例:: Rewritelog "/us/local/var/apache/logs/rewrite.log" (UNIX / Linux)

# REWRITELOG "g: /apache/rewrite.log" (Windows)

# Some common format strings are as follows:

# 能 日 格格 (CLF): "% H% L% U% T /"% r / "%> s% B"

# Universal log format with virtual host: "% V% h% L% u% T /"% r / "%> S% B" # ncsa extended / combined log format: "% h% L% u% T / "% r /"%> S% b / "% {referer} I /" / "% {user-agent} I /" "

# Referer log format: "% {referer} i ->% u"

# Agent (browser) log format: "% {user-agent} i"

######## 6.URL REWRITE

# Note: According to your server configuration, it may be necessary to make some micro modifications to the example.

# 比, newly enable MOD_ALIAS and MOD_USERDIR to increase the [PT] flag,

# Or rewritten .htaccess rather set in rather than a single server.

# To a specific rule set should first understand and then use it to avoid problems.

# 重写 语法

# REWRITEENGINE ON

# REWRITERULE ^ / $ / www / [r]

# General rewriting method

# Override page: http://gi.2288.org: 88 / modules / news / index.php

# REWRITERULE /MODULES/NEWS/index.htm full /Modules/news/index.php

# Complete page: http://gi.2288.org:88/modules/news/index.htm

# 重写 页面: http://gi.2288.org:88/modules/news/index.php?storytopic=2

# \ '

# Complete page: http://gi.2288.org:88/modules/news/topic_2.htm

# Override page: http://gi.2288.org: 88 / index.php? Storytopic = 2Start = 10

# REWRITERULE / TOPIC (.*)/ (.* )/.htm full /index.php?storytopic= $ 1&Start= $ 2

# Complete page: http://gi.2288.org:88/topic2-2.htm

# Note: For each rewriting ID, you must be accumulated $ 1

# 如如 页: http://gi.2288.org:88/CT=2X=10Y=20

# Can rewrite this:

# \ '

# 效 效: http://gi.2288.org:88/CT2-10-20.htm

# 移动 目 到 不同 不同 网站 服务

# Description:

# Typically, many network management will have such requirements when establishing a new website server:

# Redirect all host directories on a web server to another website server

# Program:

# 很 单, use mod_rewrite. Redirect all URLs on old website servers

# / ~ user / annpath to http: // newserver / ~ user / annpath.

# REWRITEENGINE ON

# REWRITERULE ^ / ~ (. ) Http: // newserver / ~ $ 1 [r, l]

# Rely on the content of the browser

# Description:

# At least for important top pages, sometimes it is necessary to provide the best content dependent on the browser.

# 即 Provide the latest version of Netscape, providing minimized versions of Lynx, and provides a feature-general version for other browsers.

# Program:

# In this, content negotiation is powerless, because the browser does not provide its form of type,

# So you can only find ways to "User-Agent" in the HTTP header.

# The following rule set can complete this action:

# If the http header "user-agent" starts with "Mozilla / 3",

#, The page foo.html is rewritten to foo.ns.html, and then the rewriting operation is terminated;

# If it is "Lynx" or "mozilla", "mozilla", it is rewritten to foo.20.html;

# And all other browsers received by foo.32.html:

# REWRITECOND% {http_user_agent} ^ mozilla / 3. *

# REWRITERULE ^ foo / .html $ foo.ns [l]

# REWRITECOND% {http_user_agent} ^ lynx /.* [or]

# REWRITECOND% {http_user_agent} ^ Mozilla / [12]. *

# REWRITERULE ^ foo / $ foo.20 [l]

# REWRITERULE ^ foo / $ foo.32 [l]

# Block Robots

# Description:

# How to prevent a fully anonymous Robot from getting a page of a specific network area?

# A / Robots.txt file can contain a number of "Robot Exclusion Protocol" lines,

#, Not enough to prevent such Robot.

# Program:

# You can use a rule set to refuse to network zones / ~ quux / foo / arc /

# (List of a deepest directory area may cause a large load to generate a large load).

# 还 还 确 确 阻 说 说 说 说 说, 说 说 不 不 不 不 不 不 不 不 不 不 不 不 不 不 不 不 不 不 不 不

# This will also prevent the user from accessing the host. To this end, you need to match the User-Agent information of the HTTP header.

# REWRITECOND% {http_user_agent} ^ NameOfbadrobot. *

# REWRITECOND% {remote_addr} ^ 123 / .45 / .67 /. [8-9] $

# REWRITERULE ^ / ~ Quux / foo / arc /. - [f]

# Prevent stealing chain pictures

# Description:

# 假 假, http: //gi.2288.org: 88 / myalbum / with some embedded pictures,

# These pictures are very good, so someone uses a super chain to their own page.

# Because this is discontinued in the traffic, we are not willing to happen this kind of thing.

# Program:

# Although we can't protect these pictures by 100% not to be written to other people's pages,

#, At least you can limit the browser that issues an HTTP Referer header.

# REWRITECOND% {http_refere}! ^ $

# REWRITECOND% {http_referer}! ^ Http: //gi.2288.org: 88 / myalbum /.* $ [nc]

# REWRITERULE. * /. GIF $ - [f]

# REWRITECOND% {http_refere}! ^ $

# REWRITECOND% {http_refeere}!. * / Foo-with-gif / .html $

# REWRITERULE ^ Inlined-in-foo / .gif $ - [f] ######## Other

# 禁 禁 链

# Setnvifnocase referer "^ http: //gi.2288.org: 88 /" local_ref = 1

#

# Order allow, deny

# Allow from env = local_ref

#

# 加载 p 5 5

# LoadingModule PHP5_Module C: /PHP/php5apache2.dll

# #AddModule MOD_PHP4.C

# Addtype Application / X-httpd-php .php

# Scriptalias / PHP / "C: / PHP /"

# Addtype Application / X-httpd-php .php

# An action application / x-httpd-php "/ php-p-cgi.exe"

# Run apache for windows in service

# You can install Apache as a Windows NT service in this way: Apache -i -n "service name"

# To install a service using a specific configuration, specify the configuration file when installing:

# Apache -i -n "service name" -f "/ my server / conf / my.conf"

# To remove an Apache service, use: apache -u -n "service name"

# Note: If you do not specify a service name, it is default, "Apache" will be used.

# Once the service is installed, you can use the -n option and other options to access the service configuration file.

# For example: Test a service configuration file: Apache -n "service name" -t

# Start a console Apache: Apache -n "Service Name" with a service configuration file

# 控制 控制 服务 服务 的 a a

# 启动, restart, and close / stop Apache service:

# Apache -n "Service Name" - K Start

# Apache -n "Service Name" - K Restart

# Apache -n "Service Name" - K Shutdown

# Apache -n "Service Name" - K Stop

# Or use the NT native command net to start and stop the Apache service, like this:

# NET START "Service Name"

# NET STOP "Service Name"

# 本 本 If you find a problem or error, you will be corrected at any time. If there is a reference, please specify the original address. - by Emerald 2005-2-15

#*********************************************************** **************** /

# *

# * author: Emerald

# *

# * HomePage: http://gi.2288.org:88/

# *

# * SEO-GI: http://seo.2288.org:99

# *

# * SiteName: Green College - Green Institute

# *

# * Date: 2005-2-15 2:03:35

# *

#*********************************************************** **************** / HTML file: * .html

# Apache Note | Apache Learning Notes (Experienced) by Emerald Green College - Green Institute

# Classification:

# 01. General Settings

# 02. Virtual host

# 03. Alias ​​

# 04. .htaccess

# 05. log

# 06. URL REWRITE

# 07. Other

######## 01. General setting

# listen

# 监 监 端,, example: Listen 80

# ServerRoot

# Apache Sitted, Example: ServerRoot "C: / Program Files / Apache Group / Apache2" (Windows)

# serveradmin

# 错误 报 邮 邮箱, example: serveradmin btbtd@yahoo.com.cn

# documentroot

# 地点 根 目, example: DocumentRoot "i: / gi-2288"

# DirectoryIndex

# Configure directory index files,

# 例: DirectoryIndex index.php index.php3 index.html index.htm

# Servername

# Server domain name / IP address, example: servername gi.2288.org

# defaultlanguage

# Set a specific default language for all files in all instruction scope

# 语法: DefaultLanguage Mime-lang, Example: DefaultLanguage EN-CN

# adddefaultcharset

# The default character set to the response in the case where the specified character set is not specified, the default value: AddDefaultCharset Off

# Example: adddefaultcharset UTF-8, Syntax: Syntax: AddDefaultcharset On | Off | Character Set

# AddHandler

# Establish mapping between file extensions and specific processors: addHandler cgi-script .cgi .pl

# 语法: AddHandler Handler-Name Extension

# AccessFileName

# Define Profile, Example: AccessFileName .htaccess

# When you return a document to the client, if you set the publishing configuration file function for this directory.

# The server will find the first existing profile from the list of each path in this document.

# Timeout

# Timeout, example: Timeout 300

# typesconfig

# Specify the location of the mime.types file, default: TypeSconfig conf / mime.types

# defaulttype

# DefaultType Mime type,

# Sometimes this happens: The server will be asked to provide a document, and the type of this document cannot be determined by its MIME type mapping.

# The server must inform the client's content type of the document.

# So when an unknown type occurs, defaultType will be used.

# 例: defaulttype image / gif

# Hostnamelookups

# Enable DNS lookup to client IP, syntax: hostnamelookups on | Off | Double

# ErrorLog

#Location server where the error log is stored.

# Loglevel

# Control the level of error logs, default: loglevel warn

# Emerg Emergency - The system cannot be used.

# Alert must take immediate action.

# crit fatal situation.

# Error error condition.

# WARN Warning situation.

# NOTICE is generally important.

# info ordinary information.

# debug error level information

# Customlog

# Set the file name and format of the log, default: Customlog logs / access.log Common

# ServerToKens

# Configure the server http response head, default: ServerToKens Full

# ServerToKens Product [UCTOONLY], the server will send (for example): Server: Apache

# ServerToKens Major, the server will send (for example): Server: Apache / 2

# ServerToKens Minor, the server will send (for example): Server: Apache / 2.0

# ServerToKens min [imal], the server will send (for example): Server: Apache / 2.0.41

# serverToKens OS, the server will send (for example): Server: Apache / 2.0.41 (UNIX)

# ServerToKens Full (or Not Specified),

# server will send (such as): Server: Apache / 2.0.41 (UNIX) PHP / 4.2.2 MyMod / 1.2

# maxspareServers

# Set the maximum number of idle processes in Apache

# 语法: MaxSpareServers Number

# Default: MaxSpareServers 100

# 例:: MaxSpareServers 1000

# maxkeepaliveRequests

# Set the maximum number of requests for each connection

# 语法: MaxkeepaliveRequests Number

# Default: MaxkeepaliveRequests 100

# serversignature

# Configure the footer of the server to generate the page, the default value: ServerSignature Off

# 语法: Serversignature ON | Off | Email

# Application:

# Listen 80

# ServerRoot "C: / Program files / apache group / apache2"

# ServerAdmin btbtd@bR>

# DocumentRoot "I: / GI-2288

# DirectoryIndex index.php index.php3 index.html index.htm
# Servername Gi.2288.org

# Defaultlanguage zh-cn

# Adddefaultcharset UTF-8

# AddDefaultCharset Off

# AddHandler CGI-Script .cgi .pl

# AccessFileName .htaccess

# TIMEOUT 300

# Typesconfig conf / mime.types

# ErrorLog "G: /Apache/dummy-gi.2288.org.80-error_log"

# Loglevel Warn

# Customlog logs / access.log common

# ServerToKens Prod [UCTONLY]

# Serversignature Off

######## 02. Virtual host

# listen 80

# Set the listening port

# Namevirtualhost 192.168.1.2:80

# 名字 / port type virtual host

#

#

# 虚 虚 主段

# serveradmin btbtd@yahoo.com.cn

# Contact management to use mailbox

# DocumentRoot "I: / GI-2288

# 站点 根点

# ServerName Gi.2288.org

# Domain name

# ErrorLog "G: /Apache/dummy-gi.2288.org.80-error_log"

# 错误 日 # Logging is a good thing, pay attention to view log record

# ------------ or more is the virtual host content

# full application:

# Listen 80

# NamevirtualHost 192.168.1.2:80

#

# ServerAdmin btbtd@bR>

# DocumentRoot "I: / GI-2288

# ServerName Gi.2288.org

#

######## 03. Alias ​​

# Syntax: ...

# Package a set of instructions that only works on file system directories with a name and its subdirectories.

# Not allowed to browse, for example:

# Alias ​​/ Document "J: / Document /"

#

# Options Followsymlinks

# Allowoverride none

# Order allow, deny

# Allow from all

#

# Allow directory browsing, examples:

# Alias ​​/ Document "J: / Document /"

#

#Boptions indexes

# Allowoverride none

# Order allow, deny

# Allow from all

#

# allow & denyl

# allow and deny instructions allow or reject access from a particular hostname or host address,

# At the same time, the ORDER directive tells Apache to process the order of these two instructions to change the filter.

# allow

# Allow access to all addresses, Example: Allow from ALL

# only allows specific IP addresses to access directory, examples: Allow from 205.252.46.165

# only allows specific domain name addresses to access directory, example: Allow from www.google.com

# only allows specific IP segments, examples: Allow from 10.10.0.0/255.255.0.0.0

# deny

# Reject all address access directories, example: Deny from all

# Reject a specific domain name access directory, example: Deny from www.google.com

# Reject specific IP access directory, Example: Deny from 218.15.84.152

# Reject an IP section access directory, example: Deny from 10.10.0.0/255.255.0.0.p>

# allow & deny mixing

# rejects all addresses, but accepts Google's access, for example:

#

# Options Followsymlinks

# Order deny, Allow

# Deny from all

# Allow from www.google.com

#

# Accept all addresses, but reject Google's access, for example:

#

# Options Followsymlinks

# Order deny, Allow

# Deny from www.google.com

# Allow from all

#

# Options

# Syntax: Options [ | -] Options [[ | -] Options] ...

# Configure which features used in a specific directory,

# OPTIONS instructions Control which server features will be used in a specific directory.

# Options can be set to None, in which case any additional characteristics will not be enabled.

# Or set one or more of the following options:

# all, all features other than MultiViews. This is the default setting.

# execcgi, allowing CGI scripts to be performed.

# FOLLOWSYMLINKS, the server will use symbolic connections in this directory.

# Note: Even if the server uses a symbol connection, it does not change the path name used to match the configuration segment.

# Note: If this configuration is in the configuration segment, this setting will be ignored.

# incrudes, allowing the server to be included.

# includeesnoexec, allows the server to include, but disable #exec commands and #exec CGI.

#, You can still use the #include virtual CGI script from the Scriptaliase directory.

# indexes, if a URL mapped to the directory is requested,

# And this directory is not DirectoryIndex (for example: index.html.zh-cn.gb2312),

# Then the server returns a list of formatted directories.

# MultiViews, allowing the content to negotiate multiple attention.

# symlinksifownermatch, the server is only used when the symbol connection is the same user ID with its destination directory or file owner.

# Note: If this configuration appears in the configuration segment, this option will be ignored.

# allowoverride

# Syntax: ALLOWOVERRIDE All | NONE | Directive Types [Instruction Type] ...

# Description: Allows the instruction type of .htaccess file

# When the server discovers a .htaccess file (specified by AccessFileName)

# It needs to know which instructions declared in this file can override the access information specified before this.

# allowOverride is only valid in section. It is invalid in or .

# If this instruction is set to None, the .htaccess file will be completely ignored.

# In this case, the server does not even try to read the .htaccess file from the file system.

# When this instruction is set to all, all instructions with .htaccess context allow the appearance in the .htaccess file.

######## 4 .htaccess

# Tip: Allow use .htaccess file will result in a decline in server performance.

# In addition, you need to read the .htaccess file each time you ask a page.

#. Open. Htaccess Support must set up allowoverride all, for example:

# alias / v "j: / pwd /"

#

#Boptions indexes

# Allowoverride all

# Order allow, deny

# Allow from all

#

# If some sensitive information on the network site or only want to be accessed for a small group,

# Here you introduce several methods to ensure that users can only access resources allowed to be accessed.

# is usually in the segment or for a single directory configuration file (.htaccess files).

# If you want to use the .htaccess file, you must set the server to allow the use of authentication instructions in these files.

# 即, specify which instructions are valid in the configuration file for a single directory with the AllowOverride instruction.

# with a password to protect the directory on the server, first requiring a password file.

# This file can be placed in the location that cannot be accessed by the network to avoid being downloaded,

# for example: g: / apache can not be accessed by the network,

# So you can consider putting your password file in the g: / apached directory.

# Apache provides tools called htpasswd in the bin sub-directory of its installation directory,

# to establish a password file, you can use this:

# (First switch to the Apache installation directory, example: c: / program files / apache group / apache2 / bin)

# Enter: htpasswd -c g: / apache / passwords e

# (This creates a user E, specifically set the user and password according to yourself)

# Next, you will ask you to enter your password, then enter once, check your password.

# This is in G: / Apache / more passwords files (no suffix name)

# WINDOWS will use MD5 encryption password.

# Built a .htaccess file in the directory to set the permissions,

The content of the

# .htaccess file is:

# Authtype Basic

# Authname "Restricted Files"

# Authorfile G: / Apache / Passwords

# Require User E

# presentation page: http://gi.2288.org:88/V

# 用户 用户: E Password: TestHtpasswd

# Note: The directory must allow AllowOverride all, so.htaccess file can take effect.

######## 5. log

# Apache's log file can provide a lot of information, it is necessary to understand these logs

# c: / program files / apache group / apache2 / logs (log file storage in Windows)

# access.log (access log, understand the content of the client access) & error.log (error log)

# Custom log format

# mod_log_config

# Status: Base

# Description: Record the request to the server to the log

# Default: Customlog Logs / Access.log Common

# Recommended settings:

# Customlog logs / access_log "% H% L% U% T"% R "% S% b"% {referer} i ""% {user-agent} i "

# logFormat

# Default: logformat "% H% L% u% T /"% r / "%> s% B"

# 语法: logformat Format | Nickname [Nickname]

# Description: Define the record format in the log file

# 例: logformat "% V% h% L% u% T /"% r / "%> S% B" vhost_common

# Customlog

# Status: Base

# 语法: Customlog file | Pipe Format | Nickname [ENV = [!] Environment-variable]

# Description: Set the file name and format of the log

# 例: Customlog logs / access_log "% h% l% u% T /"% r / "%> s% B"

# ErrorLog

# 语法: ERRORLOG File Path | syslog [: facility]

# Default: ErrorLog logs / error_log (unix) errorlog logs / error.log (Windows and OS / 2)

# Description: Locate the location of the error log

# Example: ErrorLog "G: /Apache/dummy-gi.2288.org.88-error_log"

# cookielog

# 语法: cookielog filename

# Description: Set the log file name for cookies

# Module: MOD_LOG_CONFIG

# REWRITELOG

# 语法: Rewritelog file-path

# Description: Set the file name of the rewrite engine log

# Module: MOD_REWRITE

# 例: Rewritelog "/usr/local/var/apache/logs/rewrite.log" (unix / linux)

# REWRITELOG "g: /apache/rewrite.log" (Windows)

# Some common format strings are as follows:

# You can use the log format (CLF): "% H% L% U% T /"% r / "%> S% B"

# Universal log format with virtual host: "% V% h% L% u% T /"% r / "%> S% B"

# NCSA extension / combination Log format: "% h% l% u% T /"% r / "%> S% b /"% {referer} I / "/"% {user-agent} I / "

# referer log format: "% {referer} i ->% u"

# Agent (browser) log format: "% {user-agent} i"

######## 6.url Rewrite

# Note: According to your server configuration, it may be necessary to make some micro modifications to the example.

# For example, add [Pt] flag when newly enabled_alias and mod_userdir,

# Or rewritten .htaccess rather set in rather than a single server.

# To a specific rule set should first understand and then use it to avoid problems.

# Rewriting Syntax

# REEENGINE ON

# REWWW / [R]

# General rewriting method

# Override page: http://gi.2288.org: 88 / modules / news / index.php

# REWRITERULE /MODULES/NEWS/index.htm $ /Modules/news/index.php

# Complete page: http://gi.2288.org:88/modules/news/index.htm

# Override page: http://gi.2288.org:88/modules/news/index.php?storytopic=2

# \ '

# Complete page: http://gi.2288.org:88/modules/news/topic_2.htm

# Override page: http://gi.2288.org: 88 / index.php? storytopic = 2Start = 10

# REWRITERULE / TOPIC (.*)/ (.* )/.htm full /index.php?storytopic= $ 1&Start= $2

# Complete page: http://gi.2288.org:88/topic2-2.htm

# Note: Each additional rewriting ID, must be accumulated $ 1

# 如如: http://gi.2288.org:88/CT=2X=10Y=20
# can be rewritten like this:

# REWRITERULE / CT(.* )-( )-(.* )/.htm full of / ct = $ 1X = $ 2Y = $ 3

# 效 效: http://gi.2288.org:88/CT2-10-20.htm

# Mobile host directory to different website servers

# Description:

# Typically, many network management will have such requirements when establishing a new website server:

# 重 重 All host directory on a website server to another

#print:

# 很 单, use mod_rewrite. Redirect all URL
on the old website server

# / ~ user / annpath to http: // newserver / ~ user / annpath.

# REWRITEENGINE ON

# REWRITERULE ^ / ~ (. ) Http: // newserver / ~ $ 1 [r, l]

# Rely on the browser's content

# Description:

# At least an important top page, sometimes it is necessary to provide the best content dependent on the browser,

# 即 Provide the latest Netscape to maximize version, provide minimization of Lynx,

# And provide a feature-made version for other browsers.

#print:

# In this regard, content negotiation is powerless because the browser does not provide its form of form,

# So you can only find ways to "User-Agent" in the HTTP header.

# The following rule set can complete this action:

# If the http header "user-agent" begins with "Mozilla / 3"

#, The page foo.html is rewritten to foo.ns.html, and then the rewriting operation is terminated;

# If it is "Lynx" or "mozilla", "mozilla", it is rewritten to foo.20.html;

# And all other browsers received by foo.32.html:

# REWRITECOND% {http_user_agent} ^ mozilla / 3. *

# REWRITERULE ^ foo / .html $ foo.ns [l]

# REWRITECOND% {http_user_agent} ^ lynx /.* [or]

# REWRITECOND% {http_user_agent} ^ Mozilla / [12]. *

# REWRITERULE ^ foo / $ foo.20 [l]

# REWRITERULE ^ foo / $ foo.32 [l]

# Prevent Robots

# Description:

# How to prevent a fully anonymous Robot from getting a page of a specific network area?

# 一 / /ot t 可以 行 行 行 行 行 行 行 行 行 行 行 行 行 行 行 行

#, Not enough to prevent such Robot.

#print:

# You can use a rule set to reject network area / ~ quux / foo / arc /

# (List of a deepest directory area may cause a large load to generate a large load).

# 还 还 确 确 阻 说 说 说 说 说 说 说 不 不 不, 不 不 不 不,, 不 不 阻 阻 阻, 阻, 阻, 阻

# This will also prevent the user from accessing the host. To this end, you need to match the User-Agent information of the HTTP header.

# REWRITECOND% {http_user_agent} ^ NameOfbadrobot. *

# REMOTECOND% {remote_addr} ^ 123 / .45 / .67 /. [8-9] $

# RETERULE ^ / ~ Quux / foo / arc /. - [f]

# Prevent the chain picture

# Description:

# 假 假, http: //gi.2288.org: 88 / myalbum / with some embedded pictures,

# These pictures are very good, so someone uses a super chain to their own page.

# Because this is discontinued in the traffic, we are not willing to happen this kind of thing.

#print:

# Although we can't protect these pictures by 100% not to be written to other people's page,

#, At least you can limit the browser that issues an HTTP Referer header.

# REWRITECOND% {http_referer}! ^ $

# REWRITECOND% {http_referer}! ^ Http: //gi.2288.org: 88 / myalbum /.* $ [nc]

# REWRITERULE. * /. GIF $ - [f]

# REWRITECOND% {http_referer}! ^ $

# REWRITECOND% {http_referer}!. * / Foo-with-gif / .html $

# REWRITERULE ^ inlined-in-foo / .gif $ - [f]

######## 7. Other

# 禁 链

# Setenvifnocase referer "^ http://gi.2288.org: 88 /" local_ref = 1

#
# Order allow, deny

# Allow from env = local_ref

#

# loading PHP 5

# LoadingModule PHP5_Module C: /PHP/php5apache2.dll

# # #Addmodule mod_php4.c

# Addtype Application / X-httpd-php .php

# Scriptalias / PHP / "C: / PHP /"

# Addtype Application / X-httpd-php .php

# Action Application / X-httpd-php "/php/php-cgi.exe"

# Run Apache for Windows

# You can install Apache as Windows NT service as this below: Apache -i -n "service name"

# To install a service using a specific configuration, specify the configuration file when installing:

# Apache -i -n "service name" -f "/ my server / conf / my.conf"

# To remove an Apache service, use: Apache -u -n "service name"

# Note: If you do not specify a service name, "Apache" will be used by default.

# Once the service is installed, you can use the -n option and other options to access the service configuration file.

# For example: Test a service configuration file: Apache -n "service name" -t

# Start a console Apache: Apache -n "Service Name"

# control service method Apache

# Start, restart, and close / stop apache service:

# Apache -n "Service Name" - K Start

# Apache -n "Service Name" - K Restart

# Apache -n "Service Name" - K Shutdown

# Apache -n "Service Name" -k stop

# or use NT native command NET to start and stop Apache service, like this:

# NET START "Service Name"

# NET STOP "Service Name"

# If you find a problem or error, you will be corrected at any time. If there is a reference, please specify the original address. - by Emerald 2005-2-15

# / ******************************************************** *************************** /

# *

# * Author: Emerald

# *

# * HomePage: http://gi.2288.org:88/

# *

# * SEO-GI: http://seo.2288.org:99

# *

# * SiteName: Green College - Green Institute

# *

# * Date: 2005-2-15 2:03:35

# *

#*********************************************************** ************************* /

转载请注明原文地址:https://www.9cbs.com/read-58335.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.043, SQL: 9