# 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.
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 #
# 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: #
# Allowoverride is only valid in
# 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 #
# 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
# Category:
# 01. General settings
# 02. Virtual host
# 03.
# 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.
# Listen 80
# Set the listening port
# NamevirtualHost 192.168.1.2:80
# 名字 / port type virtual host
#
# Virtualhost>
# 虚 虚 主机
# 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
# Virtualhost>
######## 03.
# 语法:
# 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
# Directory>
# Allow directory browsing, examples:
# Alias / document "j: / document /"
#
#Boptions indexes
# Allowoverride none
# Order allow, deny
# Allow from all
# Directory>
# 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
# Directory>
# Accept access to all addresses, but reject Google's access,
#
# Options Followsymlinks
# Order deny, allow
# Deny from www.google.com
# Allow from all
# Directory>
#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
# Note: If this configuration is in the
# 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
# 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
# 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
# Directory>
# 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
# Filesmatch>
# 加载 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. # 04. .htaccess > # 05. log # 06. URL REWRITE # 07. Other p> p> # listen # 监 监 端,, example: Listen 80 P> # ServerRoot # Apache Sitted, Example: ServerRoot "C: / Program Files / Apache Group / Apache2" (Windows) p> # serveradmin # 错误 报 邮 邮箱, example: serveradmin btbtd@yahoo.com.cn p> # documentroot # 地点 根 目, example: DocumentRoot "i: / gi-2288" p> # DirectoryIndex # Configure directory index files, # 例: DirectoryIndex index.php index.php3 index.html index.htm p> # Servername # Server domain name / IP address, example: servername gi.2288.org p> # defaultlanguage # Set a specific default language for all files in all instruction scope # 语法: DefaultLanguage Mime-lang, Example: DefaultLanguage EN-CN p> # 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 P> # AddHandler # Establish mapping between file extensions and specific processors: addHandler cgi-script .cgi .pl # 语法: AddHandler Handler-Name Extension p> # 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. p> # Timeout # Timeout, example: Timeout 300 p> # typesconfig # Specify the location of the mime.types file, default: TypeSconfig conf / mime.types p> # 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 p> # Hostnamelookups # Enable DNS lookup to client IP, syntax: hostnamelookups on | Off | Double p> # 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 p> # Customlog # Set the file name and format of the log, default: Customlog logs / access.log Common p> # ServerToKens # Configure the server http response head, default: ServerToKens Full p> # ServerToKens Product [UCTOONLY], the server will send (for example): Server: Apache p> # ServerToKens Major, the server will send (for example): Server: Apache / 2 p> # ServerToKens Minor, the server will send (for example): Server: Apache / 2.0 p> # ServerToKens min [imal], the server will send (for example): Server: Apache / 2.0.41 p> # serverToKens OS, the server will send (for example): Server: Apache / 2.0.41 (UNIX) p> # ServerToKens Full (or Not Specified), P> # server will send (such as): Server: Apache / 2.0.41 (UNIX) PHP / 4.2.2 MyMod / 1.2 p> # maxspareServers # Set the maximum number of idle processes in Apache # 语法: MaxSpareServers Number # Default: MaxSpareServers 100 # 例:: MaxSpareServers 1000 p> # maxkeepaliveRequests # Set the maximum number of requests for each connection # 语法: MaxkeepaliveRequests Number # Default: MaxkeepaliveRequests 100 p> # serversignature # Configure the footer of the server to generate the page, the default value: ServerSignature Off # 语法: Serversignature ON | Off | Email p> # 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 # 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 p>
p> ######## 02. p> # listen 80 # Set the listening port p> # Namevirtualhost 192.168.1.2:80 # 名字 / port type virtual host p> # # Virtualhost> # 虚 虚 主段 p> # 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 p> # full application: # Listen 80 # NamevirtualHost 192.168.1.2:80 # # ServerAdmin btbtd@bR> # DocumentRoot "I: / GI-2288 # ServerName Gi.2288.org # Virtualhost> p> p> ######## 03. P> # Syntax: # Package a set of instructions that only works on file system directories with a name and its subdirectories. p> # Not allowed to browse, for example: # Alias / Document "J: / Document /" # # Options Followsymlinks # Allowoverride none # Order allow, deny # Allow from all # Directory> p> # Allow directory browsing, examples: # Alias / Document "J: / Document /" # #Boptions indexes # Allowoverride none # Order allow, deny # Allow from all # Directory> p> # allow & denyl p> # 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. p> p> # allow # Allow access to all addresses, Example: Allow from ALL p> # only allows specific IP addresses to access directory, examples: Allow from 205.252.46.165 p> # only allows specific domain name addresses to access directory, example: Allow from www.google.com p> # only allows specific IP segments, examples: Allow from 10.10.0.0/255.255.0.0.0 p> p> # deny # Reject all address access directories, example: Deny from all p> # Reject a specific domain name access directory, example: Deny from www.google.com p> # Reject specific IP access directory, Example: Deny from 218.15.84.152 p> # Reject an IP section access directory, example: Deny from 10.10.0.0/255.255.0.0.p> p> p> # allow & deny mixing p> # rejects all addresses, but accepts Google's access, for example: # # Options Followsymlinks # Order deny, Allow # Deny from all # Allow from www.google.com # Directory> p> # Accept all addresses, but reject Google's access, for example: # # Options Followsymlinks # Order deny, Allow # Deny from www.google.com # Allow from all # Directory> p> p> # Options p> # Syntax: Options [ | -] Options [[ | -] Options] ... p> # 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: p> # all, all features other than MultiViews. This is the default setting. p> # execcgi, allowing CGI scripts to be performed. p> # 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 # Note: If this configuration is in the p> # incrudes, allowing the server to be included. p> # 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. p> # 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. p> # MultiViews, allowing the content to negotiate multiple attention. p> # 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 p> p> # allowoverride p> # Syntax: ALLOWOVERRIDE All | NONE | Directive Types [Instruction Type] ... # Description: Allows the instruction type of .htaccess file p> # 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. p> # allowOverride is only valid in p> # 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. p> p> p> # 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. p> #. Open. Htaccess Support must set up allowoverride all, for example: p> # alias / v "j: / pwd /" # #Boptions indexes # Allowoverride all # Order allow, deny # Allow from all # Directory> p> # 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. p> # is usually in the # 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. p> # 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, p> # for example: g: / apache can not be accessed by the network, # So you can consider putting your password file in the g: / apached directory. p> # Apache provides tools called htpasswd in the bin sub-directory of its installation directory, p> # to establish a password file, you can use this: # (First switch to the Apache installation directory, example: c: / program files / apache group / apache2 / bin) p> # Enter: htpasswd -c g: / apache / passwords e p> # (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. p> # This is in G: / Apache / more passwords files (no suffix name) p> # WINDOWS will use MD5 encryption password. p> # Built a .htaccess file in the directory to set the permissions, p> The content of the # .htaccess file is: # Authtype Basic # Authname "Restricted Files" # Authorfile G: / Apache / Passwords # Require User E p> # presentation page: http://gi.2288.org:88/V # 用户 用户: E Password: TestHtpasswd p> # Note: The directory must allow AllowOverride all, so.htaccess file can take effect. p> p> p> # Apache's log file can provide a lot of information, it is necessary to understand these logs p> # 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) p> # Custom log format p> # mod_log_config # Status: Base # Description: Record the request to the server to the log # Default: Customlog Logs / Access.log Common p> # Recommended settings: # Customlog logs / access_log "% H% L% U% T"% R "% S% b"% {referer} i ""% {user-agent} i " p> # 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 p> # 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" p> # 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" p> # cookielog # 语法: cookielog filename # Description: Set the log file name for cookies # Module: MOD_LOG_CONFIG p> # 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) p> # Some common format strings are as follows: p> # You can use the log format (CLF): "% H% L% U% T /"% r / "%> S% B" p> # Universal log format with virtual host: "% V% h% L% u% T /"% r / "%> S% B" p> # NCSA extension / combination Log format: "% h% l% u% T /"% r / "%> S% b /"% {referer} I / "/"% {user-agent} I / " p > # referer log format: "% {referer} i ->% u" p> # Agent (browser) log format: "% {user-agent} i" p> p> p> # 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. p> # Rewriting Syntax # REEENGINE ON # REWWW / [R] p> # General rewriting method p> # 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 p> # 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 p> # 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 p> # Note: Each additional rewriting ID, must be accumulated $ 1 # 如如: http://gi.2288.org:88/CT=2X=10Y=20 # REWRITERULE / CT(.* )-( )-(.* )/.htm full of / ct = $ 1X = $ 2Y = $ 3 # 效 效: http://gi.2288.org:88/CT2-10-20.htm p> # Mobile host directory to different website servers p> # Description: # Typically, many network management will have such requirements when establishing a new website server: # 重 重 All host directory on a website server to another P> #print: # 很 单, use mod_rewrite. Redirect all URL # / ~ user / annpath to http: // newserver / ~ user / annpath. p> # REWRITEENGINE ON # REWRITERULE ^ / ~ (. ) Http: // newserver / ~ $ 1 [r, l] p> # Rely on the browser's content p> # 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. p> #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: p> # REWRITECOND% {http_user_agent} ^ mozilla / 3. * # REWRITERULE ^ foo / .html $ foo.ns [l] p> # REWRITECOND% {http_user_agent} ^ lynx /.* [or] # REWRITECOND% {http_user_agent} ^ Mozilla / [12]. * # REWRITERULE ^ foo / $ foo.20 [l] p> # REWRITERULE ^ foo / $ foo.32 [l] p> # Prevent Robots p> # 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. p> #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. p> # REWRITECOND% {http_user_agent} ^ NameOfbadrobot. * # REMOTECOND% {remote_addr} ^ 123 / .45 / .67 /. [8-9] $ # RETERULE ^ / ~ Quux / foo / arc /. - [f] p> # Prevent the chain picture p> # 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. p> #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. p> # REWRITECOND% {http_referer}! ^ $ # REWRITECOND% {http_referer}! ^ Http: //gi.2288.org: 88 / myalbum /.* $ [nc] # REWRITERULE. * /. GIF $ - [f] p> # REWRITECOND% {http_referer}! ^ $ # REWRITECOND% {http_referer}!. * / Foo-with-gif / .html $ # REWRITERULE ^ inlined-in-foo / .gif $ - [f] p> p> p> # 禁 链 # Setenvifnocase referer "^ http://gi.2288.org: 88 /" local_ref = 1 # # Allow from env = local_ref # Filesmatch> p> # 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" p> # Run Apache for Windows P> # You can install Apache as Windows NT service as this below: Apache -i -n "service name" p> # 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" p> # To remove an Apache service, use: Apache -u -n "service name" p> # Note: If you do not specify a service name, "Apache" will be used by default. p> # 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 p> # Start a console Apache: Apache -n "Service Name" p> # control service method Apache p> # 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 p> # or use NT native command NET to start and stop Apache service, like this: # NET START "Service Name" # NET STOP "Service Name" p> p> # 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 p> # / ******************************************************** *************************** / # * # * 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 # * #*********************************************************** ************************* / p> p> td> TR> table> |