PHP code: ----------------------------------------------- ------------------------------- # Based on the NCSA service. # # This is the primary configuration file of the Apache server. # It contains the configuration instruction of the server's impact server. # See
http://httpd.ache.org/doc-2.0/
> Take more information about these instructions ## Don't just read these instruction information without understanding it. # This is just a simple explanation, if you don't have a reference online file, you will be warned. # # These configuration instructions are divided into the following three parts: # 1. Control the part of the entire Apache server behavior (ie the global environment variable) # 2. Define instructions for the primary or default service parameters, and provide default settings for all virtual hosts. Parameter # 3. Setting Parameters # # # # ## Configuration and Log File Name: If the file name you specify is "/" (Win32 "Dir: /"), the # server will use the absolute path, if the file name is not Start with "/", then it will attach the value of the serverroot # in front of the file name, for example, for "logs / foo.log", if ServerRoot value # is "/ usr / local / apache2", then The file should be "/usr/local/apache2/logs/foo.log "# ## 第一: Global Environment Parameters # # The parameters set here will affect the behavior of the entire Apache server; #, for example, Apache can process concurrency requests Quantity, etc. # #Serverroot: Indicates the root directory that the server saves its configuration, error, and log files. # # 注意! If you want to specify it as a location on NFS or other network, # Please read the documentation related to LockFile (maybe in #
http://httpd.apache.org/docs-2.0/mo...n.html#lockfile
>). # This will make you solve many problems. The end of the # # 路 Do not add a slash. # ServerRoot "/ usr / loacl / apache2" # 锁 文 必须 在 必须 本号 #号 # #lockfile logs / accept.lock ifmodule> Ifmodule> #scoreboardFile: The file used to save the internal service process information. # If it is not specified (default), the scoreboard will be saved in an anonymous shared memory segment, # and it cannot be used by third-party software. # If you specify, make sure you can't use the two Apache to use the same tab file, # This note panel file must be saved on the local disk. # #scoreboardfile logs / apache_runtime_status # #pidfile: Record files of the server startup process number. # pidfile logs / httpd.pid ifmodule> # #timeout: Receive and send a time time limit number # Timeout 300 # Keepalive: Whether a solid connection is allowed (multiple requests for each connection) The # is set to "OFF". # Keepalive ON # #MaxkeepaliveRequests: The maximum number of requests allowed during the stable connection, and # set to 0 means unlimited access.
# 我们 我们荐 You will set it into a bigger value in order to improve the performance MaxkeepaliveRequests 100 # KeepaliveTimeout: The number of seconds received from the same customer receives the request from the same customer # KeepaliveTimeout 15 ## ## server-pool size Ding (for MPM) ## # prefork MPM # startServers: Startup server started process number # minspareServers: The minimum number of spare processes 保 备用 # maxSpareServers: The maximum number of spare processes 保 # # mc:: 最 进 最 进 最number # MaxRequestsPerChild: maximum number of requests a server process allowed StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestPerChild 0 IfModule> # worker MPM # StartServers: the server boot service process number # MaxClients: allows simultaneous Maximum number of users # minsparethreads: Maximum Working thread Number # MaxSpareThreads: Maximum Working Thread Number # threadsperchild: MaxRequestSperChild: Maximum Request Maximum Number of Requests in Services Period StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 IfModule> # perchild MPM # NumServers: service process number # StartThreads: initial number of threads # MinSpareThreads each service process: to maintain the minimum number of threads # MaxSparethreads: Bottom Maximum Thread Quantity # MaxthreadSperchild: Maximum number of threads allowed by each service process # maxRequestsperchild: Each service process allows the maximum number of maximum numbers Numserv ers 5 StartThreads 5 MinSpareThreads 5 MaxSpareThreads 10 MaxThreadsPerChild 20 MaxRequestsPerChild 0 IfModule> # WinNT MPM # ThreadsPerChild: constant service process worker # MaxRequestsPerChild: maximum number of requests allowed for the process services ThreadsPerChild 250 MaxRequestsPerChild 0 IFModule> # beos MPM # Startthreads: The number of threads started when the server starts # maxclients: The maximum number of threads that can be started (a thread is equal to one user) # maxRequestsPERTHREAD: Maximum number of requests allowed by each thread Startthreads 10 MaxClients 50 maxRequestsPERTHREAD 10000 ifmodule>
# NetWare MPM # ThreadStachSize: The stack size for each working thread # startthreads: The number of threads started when the server starts # minsparethreads: The maximum number of idle threads used to handle the real request: Idle thread maximum number # Maxthreads: the maximum number of threads # MaxRequestPerChild the same time activities: a maximum number of threads service requests, # recommended to set it to 0 to enable unrestricted access ThreadStackSize 65536 StartThreads 250 MinSpareThreads 25 MaxSpareThreads 250 MaxThreads 1000 MaxRequestPerChild 0 ifmodule> # os / 2 MPM # startServers: Started service process number # minsparethreads: minimum idle threads allowed for each process # maxSparethreads: Maximum idle threads allowed for each process # maxRequestSperChild: Each service process allows for maximum Connection StartServers 2 MinSparethreads 5 MaxSparethreads 10 MaxRequestsperChild 0 ifmodule> # listen: Allows you to bind the apache service to the specified IP address and port to replace the default value # see instruction # Use the following command to listen only on the specified IP address, # to prevent it from listening to the IP address 0.0.0.0 listening # # listen 12.34.56.78:80 listen 80 # # Dynamic Sharing Support (DSO) # ## In order to be able to use those The function in the module compiled by the DSO mode, you must have the corresponding "loadModule" line, and # there is, where these instructions are included in order to activate before using it. # The static compile module does not need to list (ie, the module listed in "httpd -l") # # Example: # loadingmodule foo_module modules / mod_foo.so # # # extendedStatus: When calling "Server-Status" Control Apache is generating "full" state # information (ExtendedStatus ON) or produces basic information (ExtendedStatus OFF). # 认 为 o # ### 第 二 二: "Main" service configuration # # This area establishes the command value used by the "master" server to respond to any requests that are not handled by # . # These values also provide default values to the container defined later. # If there is definition in , the command value defined here will be overwritten by the definitions in # . # # # If you want to run httpd to run in another user or group, you must start with root in the start # and then switch it to you want User or group used. # # User / group: Users and groups running httpd Use "User Nouser" and "Group Nogroup" on SCO (ODT3). On HPUX, you may not be able to use Shared Memory as Nobody, it is recommended to create a WWW user.
# Note Some cores (KERNEL) reject setgid (group) or SemctL (IPC_SET) in group ID, and do not use "Group # -1" on these systems. # User Nobody Group # -1 ifmodule> ifmodule> # # ServerAdmin: Apache will send you an email when a problem occurs. # As an error document, this address is displayed on the server-generated page, # for example: admin@your-domain.com # serveradMinkReny@sina.com
# # Servername Specifies Apache to identify its own name and port number. #Mhus, this value is automatically specified, but we recommend that you explicitly specify it to prevent the error when you start the error # # If you specify an invalid DNS name for your host, the server-generated redirection will not work. # See UsecanonicalName instruction # # If your host is not registered with a DNS name, type it here IP address # 无, you must use its IP address to provide services, # here uses an easy understanding manner to redirect service servername
Www.dalouis.com:80
# # UsecanonicalName: Determines how apache constructs the instructions of URLS and Server_Name and Server_port. # When set to "OFF", Apache will use the host name and port number provided by the client. # When set to "ON", Apache will use the value of the ServerName instruction. # Usecanonicalname Off # # DocumentRoot: The root directory of your document. By default, all requests answers from this directory. # However, you can use symbolic links and alias to point to other locations. # DocumentRoot "/ home / redhat / public_html" # # Apache Each directory can be accessed to configure access rights (including its subdirectory). # # First, we configure a high-constrained feature. # This will prohibit access to the directory where the file system is located and add the directory block you want to access. # 如下 Order Deny, Allow Deny from all directory> # # Note From here you must explicitly allow which special features are allowed to be used. # - So, if Apache doesn't work as you expect, # Please check if you are specifying it available below. # # # This will change to Documentroot # # Options you set: This instruction can be "none", "all", or any combination of the following options: # indexes Includedes Followsymlinks SymlinksifownerMatch Execcgi MultiViews # # Note that "MultiViews" must be explicitly specified, "Options all" cannot provide you with this feature. # ## This instruction is both complex and important, please refer to # " http://httpd.apache.org/docs-2.0/mo ... more information? lt; / a
> # Options Followsymlinks # # allowOverride Controls those that are placed in the .htaccess file. # It can be a combination of "all", "none", or the following instructions: #boptions fileInfo authconfig limit # allowoverride none # # Who can get a service. # ORDER ALLOW, DENY Allow from all directory> # # Userdir: Specifies the directory name after you get a home directory when you get one ~ user request. # UserDir public_html # To prevent vulnerabilities on the UserDir instruction, setting the root user settings # "./" This userdir is very useful. # If you use Apache 1.3 or above, we strongly recommend that you contain the following row UserDir Disabled root # # below is an example of read-only properties using the userdir directory to make a site of the site: # # # AllowOverride FileInfo AuthConfig Limit Indexes # Options MultiViews Indexes SymLinksIfOwnerMatch IncludeNoExec # # Order allow, deny # Allow from all # Limit> # # Order deny, allow # deny from all # limited >xPT> # DirectoryIndex: Define Request is a directory, Apache provides a service file name # # index.html.var file (one Type Image Files) Used to provide a list of documents, # for the same purpose, but it will use the MultiViews option, but it will be very slow. # DirectoryIndex index.php index.html index.html.var # atcessFileName: The file name of the file that provides additional configuration instructions is provided for each directory. # See Allowoverride Directive. # AccessFileName .htaccess # # The row below prevents .htaccess and .htpasswd files are viewed by the web customer. # ORDER ALLOW, DENY DENY from ALL files> # # typeconfig: Where to query MIME.TYPES files. # TypeConfig conf / mime.types # defaultty: Definition When you cannot determine the default MIME type provided by the server when the MIME type is not determined. # If your service mainly contains text or html document, "text / plain" is a good choice; # If most is binary document, such as software or images, you should use # "Application / Octer-Stream" to prevent browsers A binary file is displayed like a text. # Defaulttype text / plain # # mod_mime_magic Allow the service 鞔鞔 约 ㄒ遄 奈 惺 惺 煌 煌 煌 鳎 鳎,,,,, 煌 文件 鳎
# MIMEMAGICFILE CONF / MAGIC IFModuL> # # hostnamelookups: Specify the name of the recorder or IP address, for example, when this directive is ON # 记 主 host name, such as www.apache.org; record IP address, 204.62.129.132.
# The default value is OFF, which is much better than set to ON, because if it is set to ON, each user request will # at least a query for Nameserver. # Hostnamelookups Off # # enablemmap: Controls whether to perform memory dump (if the operating system is supported). # 认 为 on, if your server is installed on the network file system (NFS), turn it off. # On some systems, close it will increase system performance (independent of file system type); # for example, see
http://httpd.apache.org/docs-2.0/mo...html#enablemap
# # Enablemap Off # # enablesendfile: Controls whether to use SendFile Kernel to support send file # (if the operating system is supported). The default is ON, if your server is installed on the Network File System # (NFS), please close it. # See
http://httpd.apache.org/docs-2.0/mo...#enablesendfile
# # Enablesendfile Off # # ErrorLog: Error Log File Location. # If you don't define an ErrorLog instruction within , this virtual host's error message # will record it here. If you define ERRORLOG there, these error messages will be recorded in the file you # defined instead of defined files. # RRLOG logs / error_log # # loglevel: Control the number of log information recorded in the error log file. # Possible values include: Debug, Info, NOTICE, WARN, Error, crit, Alert, Emerg. # Loglevel Warn # # The following instruction defines the format alias for the CustomLog command. # Logformat "% H% L% u% T /"% r / "%> S% b /"% {referer} I / "/" "combined logformat"% h% L % U% T / "% r /"%> s% b "common logformat"% {referer} i ->% u "referer logformat"% {user-agent} i "Agent # you need to install MOD_LOGIO.C module You can use% i and% o. # Logformat "% H% L% U% T /"% R / "%> S% b /"% {referer} I / "/"% {user-agent} I / "% I% o" Combinedio # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Specify the positioning and format of the access log file (general log format). # If you don't define this instruction within , the transfer information will be recorded here, # If you define this instruction, record the location you specified instead of the defined position. # Customlog logs / access_log common # # If you want to record Agent and Referer information, you can use the following instructions # # Customlog logs / referer_log referer # CustomLog logs / agent_log agent # # If you want to use a file record Access, Agent, Referer information, # You can define this instruction below: # #ustom logs / access_log combined # # ServerToKens # This command defines the type of information included in the HTTP response header. The default is "full", # this means that the operating system type and compilation information in the module are included in the response header. # You can be set to one of the columns: #full | OS | Minor | Minimal | Major | Prod # full of information conveyed, and Ltd. # ServerToKens Full # # Free Add Containers to Server Version and Virtual Host Name Mouth Information to Server-Generated Output Page # (Internal Error Document, FTP Directory List, MOD_STATUS and MOD_INFO Output, etc., in addition to CGI error # or custom errors Outside the documentation). # Set to "email" will contain a MailTo pointing to ServerAdmin: connection.
# You can be the following: ON | Off | Email # Serversignature ON # # aliases: Add your alias you need, the format is as follows: # alias alias true name # # 注意, if you have the alias, you contain "/ ", Then" / "is also required in the URL. # Therefore, "/ icons" is not alias in this example. # If the alias is ended with "/", the real name must also end with "/", # If the alias is omitted "/", then the real name must also be omitted. # # We use alias "/ icons /" to represent the FancyIndexed directory list, if you don't use, # fancyIndexing, you can comment. # # Alias / icons / "/ usr / local / apache2 / icons /" # # options indexes multiviews # allowoverride none # Order, Deny ## allow from all # < / DIRECTORY> # # This will change ServerRoot / Manual. This alias provides the location where the man page is located, "even if you change your documentroot. If you don't care if you have a message page, # You can comment it. # Alias / manual "/ usr / loacl / apache2 / manual" Options Indexes FollowSymLinks MultiViews IncludesNoExec AddOutputFilter Includes html Order allow, deny Allow from all Directory> # # ScriptAlias: Specifies the directory containing the service script. # Scriptaliases is in nature, like AliaSes, except that the document here is proceed to process processing during the request. # 的 "/" Rule with Alias # Scriptalias / CGI-BIN / "/ usr / loacl / apache2 / cgi-bin /" # This is the intended command addType Application / X-httpd-php .php loadingModule PHP4_MODULE MODULES / LIBPHP4.SO # # Add mod_cgid.c setting, MOD_CGID provides a # script interface path for UNIX sockets using CGID. # # Scriptsock logs / cgisock ifmodule> # # Change "/ usr / local / apache2 / cgi-bin" to your scriptaliase design specified CGI directory, # if you are configured. # ALLOWOVERRIDE NONE OPTIONS NONE ORDER ALLOW, DENY Allow from all directory> # # redirect Allow you to tell the client using documents existing in the server name space, # Instead, this helps customers locate documents that change the location.
#, For example: # redirect permanent / foo http://www.example.com/bar
# # Controls the Server-Generated Directory list displayed instruction # # indexoptions: Control the Server-Generated Directory list display feature. # Indexoptions fancyindexing versionsORT # # addicon * instruction tells the server how to display different extensions, # only for FancyIndexed instructions # addiconbyencoding (cmp, / icons / compressed.gif) X-compress x-gzip addiconbype (txt, / icons / Text.gif) Text # Profiles based on NCSA services. # # This is the primary configuration file of the Apache server. # It contains the configuration instruction of the server's impact server. # See
http://httpd.ache.org/doc-2.0/
> Take more information about these instructions ## Don't just read these instruction information without understanding it. # This is just a simple explanation, if you don't have a reference online file, you will be warned. # # These configuration instructions are divided into the following three parts: # 1. Control the part of the entire Apache server behavior (ie the global environment variable) # 2. Define instructions for the primary or default service parameters, and provide default settings for all virtual hosts. Parameter # 3. Setting Parameters # # # # ## Configuration and Log File Name: If the file name you specify is "/" (Win32 "Dir: /"), the # server will use the absolute path, if the file name is not Start with "/", then it will attach the value of the serverroot # in front of the file name, for example, for "logs / foo.log", if ServerRoot value # is "/ usr / local / apache2", then The file should be "/usr/local/apache2/logs/foo.log "# ## 第一: Global Environment Parameters # # The parameters set here will affect the behavior of the entire Apache server; #, for example, Apache can process concurrency requests Quantity, etc. # #Serverroot: Indicates the root directory that the server saves its configuration, error, and log files. # # 注意! If you want to specify it as a location on NFS or other network, # Please read the documentation related to LockFile (maybe in #
http://httpd.apache.org/docs-2.0/mo...n.html#lockfile
>). # This will make you solve many problems. The end of the # # 路 Do not add a slash. # ServerRoot "/ usr / loacl / apache2" # 锁 文 必须 在 必须 本号 #号 # #lockfile logs / accept.lock ifmodule> Ifmodule> #scoreboardFile: The file used to save the internal service process information. # If it is not specified (default), the scoreboard will be saved in an anonymous shared memory segment, # and it cannot be used by third-party software. # If you specify, make sure you can't use the two Apache to use the same tab file, # This note panel file must be saved on the local disk. # #scoreboardfile logs / apache_runtime_status # #pidfile: Record files of the server startup process number. # pidfile logs / httpd.pid ifmodule> # #timeout: Receive and send a time time limit number # Timeout 300 # Keepalive: Whether a solid connection is allowed (multiple requests for each connection) The # is set to "OFF". # Keepalive ON # #MaxkeepaliveRequests: The maximum number of requests allowed during the stable connection, and # set to 0 means unlimited access.
# 我们 我们荐 You will set it into a bigger value in order to improve the performance MaxkeepaliveRequests 100 # KeepaliveTimeout: The number of seconds received from the same customer receives the request from the same customer # KeepaliveTimeout 15 ## ## server-pool size Ding (for MPM) ## # prefork MPM # startServers: Startup server started process number # minspareServers: The minimum number of spare processes 保 备用 # maxSpareServers: The maximum number of spare processes 保 # # mc:: 最 进 最 进 最number # MaxRequestsPerChild: maximum number of requests a server process allowed StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestPerChild 0 IfModule> # worker MPM # StartServers: the server boot service process number # MaxClients: allows simultaneous Maximum number of users # minsparethreads: Maximum Working thread Number # MaxSpareThreads: Maximum Working Thread Number # threadsperchild: MaxRequestSperChild: Maximum Request Maximum Number of Requests in Services Period StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 IfModule> # perchild MPM # NumServers: service process number # StartThreads: initial number of threads # MinSpareThreads each service process: to maintain the minimum number of threads # MaxSparethreads: Bottom Maximum Thread Quantity # MaxthreadSperchild: Maximum number of threads allowed by each service process # maxRequestsperchild: Each service process allows the maximum number of maximum numbers Numserv ers 5 StartThreads 5 MinSpareThreads 5 MaxSpareThreads 10 MaxThreadsPerChild 20 MaxRequestsPerChild 0 IfModule> # WinNT MPM # ThreadsPerChild: constant service process worker # MaxRequestsPerChild: maximum number of requests allowed for the process services ThreadsPerChild 250 MaxRequestsPerChild 0 IFModule> # beos MPM # Startthreads: The number of threads started when the server starts # maxclients: The maximum number of threads that can be started (a thread is equal to one user) # maxRequestsPERTHREAD: Maximum number of requests allowed by each thread Startthreads 10 MaxClients 50 maxRequestsPERTHREAD 10000 ifmodule>
# NetWare MPM # ThreadStachSize: The stack size for each working thread # startthreads: The number of threads started when the server starts # minsparethreads: The maximum number of idle threads used to handle the real request: Idle thread maximum number # Maxthreads: the maximum number of threads # MaxRequestPerChild the same time activities: a maximum number of threads service requests, # recommended to set it to 0 to enable unrestricted access ThreadStackSize 65536 StartThreads 250 MinSpareThreads 25 MaxSpareThreads 250 MaxThreads 1000 MaxRequestPerChild 0 ifmodule> # os / 2 MPM # startServers: Started service process number # minsparethreads: minimum idle threads allowed for each process # maxSparethreads: Maximum idle threads allowed for each process # maxRequestSperChild: Each service process allows for maximum Connection StartServers 2 MinSparethreads 5 MaxSparethreads 10 MaxRequestsperChild 0 ifmodule> # listen: Allows you to bind the apache service to the specified IP address and port to replace the default value # see instruction # Use the following command to listen only on the specified IP address, # to prevent it from listening to the IP address 0.0.0.0 listening # # listen 12.34.56.78:80 listen 80 # # Dynamic Sharing Support (DSO) # ## In order to be able to use those The function in the module compiled by the DSO mode, you must have the corresponding "loadModule" line, and # there is, where these instructions are included in order to activate before using it. # The static compile module does not need to list (ie, the module listed in "httpd -l") # # Example: # loadingmodule foo_module modules / mod_foo.so # # # extendedStatus: When calling "Server-Status" Control Apache is generating "full" state # information (ExtendedStatus ON) or produces basic information (ExtendedStatus OFF). # 认 为 o # ### 第 二 二: "Main" service configuration # # This area establishes the command value used by the "master" server to respond to any requests that are not handled by # . # These values also provide default values to the container defined later. # If there is definition in , the command value defined here will be overwritten by the definitions in # . # # # If you want to run httpd to run in another user or group, you must start with root in the start # and then switch it to you want User or group used. # # User / group: Users and groups running httpd Use "User Nouser" and "Group Nogroup" on SCO (ODT3). On HPUX, you may not be able to use Shared Memory as Nobody, it is recommended to create a WWW user.
# Note Some cores (KERNEL) reject setgid (group) or SemctL (IPC_SET) in group ID, and do not use "Group # -1" on these systems. # User Nobody Group # -1 ifmodule> ifmodule> # # ServerAdmin: Apache will send you an email when a problem occurs. # As an error document, this address is displayed on the server-generated page, # for example: admin@your-domain.com # serveradMinkReny@sina.com
# # Servername Specifies Apache to identify its own name and port number. #Mhus, this value is automatically specified, but we recommend that you explicitly specify it to prevent the error when you start the error # # If you specify an invalid DNS name for your host, the server-generated redirection will not work. # See UsecanonicalName instruction # # If your host is not registered with a DNS name, type it here IP address # 无, you must use its IP address to provide services, # here uses an easy understanding manner to redirect service servername
Www.dalouis.com:80
# # UsecanonicalName: Determines how apache constructs the instructions of URLS and Server_Name and Server_port. # When set to "OFF", Apache will use the host name and port number provided by the client. # When set to "ON", Apache will use the value of the ServerName instruction. # Usecanonicalname Off # # DocumentRoot: The root directory of your document. By default, all requests answers from this directory. # However, you can use symbolic links and alias to point to other locations. # DocumentRoot "/ home / redhat / public_html" # # Apache Each directory can be accessed to configure access rights (including its subdirectory). # # First, we configure a high-constrained feature. # This will prohibit access to the directory where the file system is located and add the directory block you want to access. # 如下 Order Deny, Allow Deny from all directory> # # Note From here you must explicitly allow which special features are allowed to be used. # - So, if Apache doesn't work as you expect, # Please check if you are specifying it available below. # # # This will change to Documentroot # # Options you set: This instruction can be "none", "all", or any combination of the following options: # indexes Includedes Followsymlinks SymlinksifownerMatch Execcgi MultiViews # # Note that "MultiViews" must be explicitly specified, "Options all" cannot provide you with this feature. # ## This instruction is both complex and important, please refer to # " http://httpd.apache.org/docs-2.0/mo ... more information? lt; / a
> # Options Followsymlinks # # allowOverride Controls those that are placed in the .htaccess file. # It can be a combination of "all", "none", or the following instructions: #boptions fileInfo authconfig limit # allowoverride none # # Who can get a service. # Otder allow, deny allow from all directory>