义齿conf中国語版



###          Windows(    ) Linux(    ),  MPM       

##########################################################################################
####              [          "server config"   "virtual host"]  #####
##########################################################################################

#####################################################################
##### MPM   (  MPM           ) #####

##### prefork   mpm_winnt      

  #      (Linux Apache root            ,              )
  #CoreDumpDirectory /share/empty

  #   IP   80   HTTP  
   Listen 80 http

  #          ,      ,       SYN-Cookie  SYN  。
   ListenBacklog 255

  #           free()                 (  "0"     )
   MaxMemFree 0

  #                            ,    (   )        ,                       
   MaxRequestsPerChild 10000

  #     (    )PID   
<IfModule mpm_winnt_module>
   PidFile log/httpd.pid
</IfModule>
<IfModule mpm_prefork_module>
   PidFile /var/run/httpd.pid
</IfModule>

  #TCP       (   8 ,    http      4 )
   ReceiveBufferSize 11840
  #TCP       (   8 ,                  )
   SendBufferSize 11840

  #                 ,                   
  #ScoreBoardFile /tmp/httpd_status

##### mpm_winnt     
<IfModule mpm_winnt_module>
  #              ,   ThreadsPerChild            
   ThreadLimit 5
  #           (      ThreadLimit)
   ThreadsPerChild 5

  #                (65536  ),               
  #ThreadStackSize 65536

  #        AcceptEx()        
  #Win32DisableAcceptEx
</IfModule>

##### prefork     
<IfModule mpm_prefork_module>
  #           socket accept()     (       Listen        )
  #    Linux 2.6      Glibc    NPTL   posixsem  
  #  ,        ,          Listen  。
   AcceptMutex posixsem
  # AcceptMutex     fcntl flock   ,Apache         (    TMPFS )
  #                        ,         
   LockFile /tmp/httpd_accept.lock

  #                  
   EnableExceptionHook Off

  #            (5  )
   GracefulShutDownTimeout 300

  #        
   Group www
  #         
   User httpd

  #               (           )
  #     postgresql max_connections   (                   )
   MaxClients 1000
  #             (   MaxClient  )
   ServerLimit 1000
  #             
   StartServers 30
  #          (           )
   MaxSpareServers 30
  #          
   MinSpareServers 15
</IfModule>


#####################################################################
##### mod_so  (      Load..  ,         ) #####

<IfModule mpm_winnt_module>
#  Linux            httpd,         (PHP  )
#    :Windows   mod_info/mod_status/mod_bw Linux    。

  #                       
   LoadModule auth_digest_module bin/mod_auth_digest.so
   LoadModule authn_default_module bin/mod_authn_default.so
   LoadModule authn_file_module bin/mod_authn_file.so
   LoadModule authz_default_module bin/mod_authz_default.so
   LoadModule authz_user_module bin/mod_authz_user.so
   LoadModule authz_host_module bin/mod_authz_host.so

  #     (     )    
   LoadFile   bin/zlib1.dll
   LoadModule deflate_module bin/mod_deflate.so

  #               "   "   (  phppgadmin  )
   LoadModule dir_module bin/mod_dir.so

  #      
   LoadModule env_module bin/mod_env.so
   LoadModule setenvif_module bin/mod_setenvif.so

  #        "Expires:" "Cache-Control:"   
   LoadModule expires_module bin/mod_expires.so

  #           
   LoadModule log_config_module bin/mod_log_config.so

  # MIME  (PHP      )
   LoadModule mime_module       bin/mod_mime.so

  #    URL  
   LoadModule rewrite_module bin/mod_rewrite.so

  #  Apache     Web  
   LoadModule info_module bin/mod_info.so
  #          Web  
   LoadModule status_module bin/mod_status.so
  #       (      internet  )[Http://apache.ivn.cl]
   #LoadModule bw_module bin/mod_bw.so
</IfModule>

#####   PHP5  
<IfModule mpm_winnt_module>
   LoadFile   php/php5ts.dll
   LoadModule php5_module  php/php5apache2_2.dll
   PHPINIDir  php
</IfModule>
<IfModule mpm_prefork_module>
   LoadModule php5_module  /lib/httpd/libphp5.so
   PHPINIDir  /etc/httpd
</IfModule>
   AddType  application/x-httpd-php  .php .htm


#####################################################################
#####             (Core)   #####

#         Socket    
#AcceptFilter http data
#AcceptFilter https data

#     HTTP       
 LimitRequestFields 20
#     HTTP       
 LimitRequestFieldSize 3000
#     HTTP       
 LimitRequestLine 1020

#        IP     80
 NameVirtualHost *:80

#      (       ),                   
<IfModule mpm_winnt_module>
 ServerRoot /GreenAPP/Apache
</IfModule>
<IfModule mpm_prefork_module>
 ServerRoot /share/empty
</IfModule>

#"Server:"   (Prod  ,Full  )
 ServerTokens Prod

#     
 TimeOut 15

#    TRACE  
 TraceEnable off


#####################################################################
#####                    #####

# mime.types     (mod_mime)
<IfModule mpm_winnt_module>
 TypesConfig conf/mime.types
</IfModule>
<IfModule mpm_prefork_module>
 TypesConfig /etc/httpd/mime.types
</IfModule>

#         nonce   (    )(mod_auth_digest)
#AuthDigestNcCheck On

#                  (mod_auth_digest),     128  。
 AuthDigestShmemSize 25600

#          (mod_log_config)
 BufferedLogs Off

#   RewriteMap*  *              (mod_rewrite)
#RewriteLock file-path

<IfModule status_module>
  #              
   ExtendedStatus On
</IfModule>



################################################################################################
####               [             "server config" "virtual host"]   #####
################################################################################################
##                  ,       "    ",                       ##

#####################################################################
#####             (Core)   #####

####              

  #       (         ,       )(        )
  #DocumentRoot directory-path
  #     ServerName ,       IP              。
  #  ,                  
   ServerName xx.xx.xx.xx

####     

  #          
   AccessFileName .htaccess
  #              
   Options FollowSymLinks

####      

  #      text/plain text/html  HTTP            
   AddDefaultCharset utf-8
  #              ,     MIME    
   DefaultType application/octet-stream
  #    Content-MD5   
   ContentDigest Off
  #    ETag         
   FileETag All

####       

  #                        
   AcceptPathInfo Off
  #  URL             
   AllowEncodedSlashes Off

  #                  (   5)
   LimitInternalRecursion 10
  #        HTTP          (1.2M)
   LimitRequestBody 1300000
  #    XML           (1.2M)
   LimitXMLRequestBody 1300000

<IfModule mpm_prefork_module>
  #  Apache          CPU     
   RLimitCPU 1 1
  #   Apache                  
   RLimitMEM 1 1
  #   Apache                
   RLimitNPROC 0 1
</IfModule>

  #               
   ServerSignature Off

####     

  #               (         )
   EnableMMAP On
  #         sendfile            
   EnableSendfile On
  #      IP DNS  
   HostnameLookups Off
  #    (  )
   KeepAlive Off
   KeepAliveTimeout 1
   MaxKeepAliveRequests 1

####          

  #       
  #400      
   ErrorDocument 400 /error/http|ErrCode=400.htm
  #403     
   ErrorDocument 403 /error/http|ErrCode=403.htm
  #404    
   ErrorDocument 404 /error/http|ErrCode=404.htm
  #405       
   ErrorDocument 405 /error/http|ErrCode=405.htm
  #406        MIME   Accpet       
   ErrorDocument 406 /error/http|ErrCode=406.htm
  #408                         
   ErrorDocument 408 /error/http|ErrCode=408.htm
  #409                      (   PUT  )
   ErrorDocument 409 /error/http|ErrCode=409.htm
  #410                                
   ErrorDocument 410 /error/http|ErrCode=410.htm
  #411     Content-Length       
   ErrorDocument 411 /error/http|ErrCode=411.htm
  #412            
   ErrorDocument 411 /error/http|ErrCode=412.htm
  #413       
   ErrorDocument 413 /error/http|ErrCode=413.htm
  #414   URI  
   ErrorDocument 414 /error/http|ErrCode=414.htm
  #415     MIME  
   ErrorDocument 415 /error/http|ErrCode=415.htm
  #416 Range           
   ErrorDocument 416 /error/http|ErrCode=416.htm
  #417     
   ErrorDocument 417 /error/http|ErrCode=417.htm
  #423      
   ErrorDocument 423 /error/http|ErrCode=423.htm
  #500        
   ErrorDocument 500 /error/http|ErrCode=500.htm
  #501                 
   ErrorDocument 501 /error/http|ErrCode=501.htm
  #502                      
   ErrorDocument 502 /error/http|ErrCode=502.htm
  #503                      
   ErrorDocument 503 /error/http|ErrCode=503.htm
  #504                (           )
   ErrorDocument 504 /error/http|ErrCode=504.htm
  #505              HTTP  
  #ErrorDocument 505 /error/http|ErrCode=505.htm

  #                      
   ServerAdmin [email protected]

  #    (     )
<IfModule mpm_winnt_module>
   ErrorLog log/error.log
   LogLevel info
</IfModule>
<IfModule mpm_prefork_module>
   ErrorLog /var/log/httpd/error.log
   LogLevel warn
</IfModule>

####    

<IfModule mpm_winnt_module>
  #  CGI     (   Win32)
   ScriptInterpreterSource Script
</IfModule>

  #                    
  #SetHandler handler-name|None

####        

  #          (         ,         )
   AddOutputFilterByType  DEFLATE  application/x-javascript application/xhtml+xml application/xslt+xml application/xml application/xml-dtd text/css text/html text/plain text/richtext text/rtf text/xml

  #          POST         
  #SetInputFilter filter[;filter...]
  #                 
  #SetOutputFilter filter[;filter...]

####    

  #                   URL
  #                      #                       (         )
   UseCanonicalName Off
   UseCanonicalPhysicalPort Off


#####################################################################
#####                (DSO)    #####

#### mod_deflate ####

  #  zlib         (  )(20K),           
   DeflateBufferSize 20240
  #    ,      1(     )   9(     )  
   DeflateCompressionLevel 3
  #                     (  )
  #DeflateFilterNote Input instream
  #DeflateFilterNote Output outstream
  #DeflateFilterNote Ratio ratio
  #             (     1 9  )
   DeflateMemLevel 9
  #       (     1 15  ,        )
   DeflateWindowSize 15

  #      (/)      (     ,      )
  #         (          )
<IfModule mpm_prefork_module>
   DirectorySlash On
   DirectoryIndex index.html index.htm index.php
</IfModule>
<IfModule mpm_winnt_module>
   DirectorySlash Off
   DirectoryIndex none
</IfModule>

#### mod_env #####
#### mod_setenvif #####

  #  shell      
  #PassEnv env-variable [env-variable] ...
  #  gzip  [      ,       ]
  #SetEnv   force-gzip 1
  #      (           )
   UnsetEnv AccessLog
  #               (    txt/php/html   )
   SetEnvIf Request_URI  "\.(txt|php|html?)$"  AccessLog=1

##### mod_expires #####

  #  "Expires:" "Cache-Control:" 
   ExpiresActive On
  # MIME     Expires   
  #ExpiresByType MIME-type <code>seconds
  #           30 
    ExpiresDefault "access plus 30 days"
  #  php          (              )
  <Files *.php>
    ExpiresActive Off
  </Files>

##### mod_log_config #####

  #    (    +      )(      )
<IfModule mpm_winnt_module>
   CustomLog log/access.log "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" env=AccessLog
</IfModule>
<IfModule mpm_prefork_module>
   CustomLog /var/log/httpd/access.log "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" env=AccessLog
</IfModule>

##### mod_mime #####

  #                      
  #AddEncoding MIME-enc extension [extension] ...
  #    .html.gz .css.gz              "Content-Encoding: gzip"   ,
  #           mod_deflate       CPU
  #                              ,              ,
  #   mod_expires   ,          
  #         AddOutputFilterByType  DEFLATE ....     ,                
  #AddEncoding gzip .gz

  #              (    )
   DefaultLanguage zh-CN

  #   MultiViews                 
  #NegotiatedOnly                                  mod_mime   ,
  #  :   、    、  、    。                   ,         。
   MultiviewsMatch NegotiatedOnly

  #                      
  #AddCharset charset extension [extension] ...
  #                  
  #AddLanguage MIME-lang extension [extension] ...
  #                   
  #AddHandler handler-name extension [extension] ...
  #                     
  #AddInputFilter filter[;filter...] extension [extension] ...
  #                       
  #AddOutputFilter filter[;filter...] extension [extension] ...
  #                       
  #AddType MIME-type extension [extension] ...

##### mod_rewrite #####

  #      (    ,                 )
   RewriteEngine Off
  #           (9-   ,0-  )
   RewriteLogLevel 0
  #            (   、  、  )
  #RewriteOptions inherit

  #         (        )   (     #..  ,         )
   RewriteCond  %{REQUEST_URI}  \.htm$
   RewriteRule  ^(.+)\.htm$             $1.php       [NE,C]
   RewriteRule  ^([^|]+)\|(.+)\.php$    $1.php?$2    [NE,L]

<IfModule info_module>
  # server-info              
  #AddModuleInfo module-name string
</IfModule>

<IfModule bw_module>
  #      (      ,         )
   BandWidthModule On
  #           
   ForceBandWidthModule On
  #     。   BandWidth       ,           。
   MaxConnection 127.0.0.0/8     2
  #    (B/s)。     16Kbps
   BandWidth 127.0.0.0/8     2048
  #    (B/s),  "-1"       。
   MinBandWidth all -1
  #          1024        ,    1024-131072,   8192。
   BandWidthPacket 1024
  #     50kB            8Kbps
  #LargeFileLimit * 50 1024
  #    MaxConnection      "503"    (HTTP_SERVICE_UNAVAILABLE),
  #                   (300~599)   ErrorDocument              。
  #BandWidthError 510
</IfModule>


################################################################################################
####               /  /  /    [          "directory"]   #####
################################################################################################
##               ,             "  " ##
##               "directory"    ##

<Directory />
  #  .htaccess  (      )
   AllowOverride None
  #              (      )
   Options FollowSymLinks
  #                  
   Satisfy all
  #      
   AuthType Digest
   AuthDigestAlgorithm MD5
   AuthDigestNonceLifetime 1200
   AuthDigestQop auth
   AuthDigestProvider file
   AuthDefaultAuthoritative On
  #           /    
<IfModule mpm_winnt_module>
   AuthUserFile conf/authn.md5
</IfModule>
<IfModule mpm_prefork_module>
   AuthUserFile /etc/httpd/authn.md5
</IfModule>
   AuthzUserAuthoritative On
   AuthzDefaultAuthoritative On
  #      (mod_authz_host)
  #Allow from 127.0.0.1
   Deny from all
   Order Allow,Deny
</Directory>

#  <DirectoryMatch>   <Directory>    ,              "secret"  
<DirectoryMatch /secret/>
   AllowOverride None
   Options FollowSymLinks
   Satisfy all
   Deny from all
   Order Allow,Deny
</DirectoryMatch>

##            ,              ,  <Location>     
##        GET POST         !!!
#<Location />
#      GET POST  (      )
#<LimitExcept GET POST>
#  Order Allow,Deny
#  Deny from all
#</LimitExcept>
#</Location>


############################################################################
####               [           "virtual host"]   #####
############################################################################

<VirtualHost *:80>
#(     ,                      )
  #      、      
   DocumentRoot /www/oklaoshi/www
    ServerName   oklaoshi.org
    ServerAlias  oklaoshi.net oklaoshi.com oklaoshi.cn
    ServerAlias  www.oklaoshi.org www.oklaoshi.net   www.oklaoshi.com www.oklaoshi.cn

    #               (   、  、  )
     RewriteEngine On
     RewriteOptions inherit

    #  shell        (                )
    #PassEnv ENCRYPT_KEY

    #    PHP           
     php_admin_value open_basedir  "/www/oklaoshi/"
     php_admin_flag  file_uploads Off
     php_admin_value include_path  "/www/oklaoshi/secret"
     php_admin_value session.name  "OKLAOSHISESSIONID"
     php_admin_value session.referer_check  "oklaoshi."

    #        
     UnsetEnv  Local_Referer
    #         
     SetEnvIf Referer "oklaoshi\.(org|net|com|cn)" Local_Referer

  <Directory   "/www/oklaoshi/www">
      Order Allow,Deny
      Allow from all
    #    (    <Directory>  )
    <FilesMatch "\.(js|css|gif|jpe?g|png|swf)$">
      Order Allow,Deny
      Allow from env=Local_Referer
    </FilesMatch>
  </Directory>

####                
  #                     
  #RemoveCharset extension [extension] ...
  #                      
  #RemoveEncoding extension [extension] ...
  #                  
  #RemoveHandler extension [extension] ...
  #                  
  #RemoveInputFilter extension [extension] ...
  #                  
  #RemoveLanguage extension [extension] ...
  #                  
  #RemoveOutputFilter extension [extension] ...
  #                 
  #RemoveType extension [extension] ...

##        
  <IfModule info_module>
  <Location /server-info>
    SetHandler server-info
    AuthName Apache_Admin
    Require user Apache_Admin
    Satisfy all
    Order Allow,Deny
    Allow from all
  </Location>
  </IfModule>

##        
  <IfModule status_module>
  <Location /server-status>
    SetHandler server-status
    AuthName Apache_Admin
    Require user Apache_Admin
    Satisfy all
    Order Allow,Deny
    Allow from all
  </Location>
  </IfModule>

</VirtualHost>



############################################################################
####                  #####
############################################################################

<VirtualHost *:80>

  #      、      ( "    "        "    ")(.org/.net   .com/.cn  )(       )
   DocumentRoot /www/oklaoshi/htdocs
    ServerName   bj.oklaoshi.org
    ServerAlias                   bj.oklaoshi.net    bj.oklaoshi.com  bj.oklaoshi.cn
    ServerAlias  tj.oklaoshi.org  tj.oklaoshi.net    tj.oklaoshi.com  tj.oklaoshi.cn
    ServerAlias  sh.oklaoshi.org  sh.oklaoshi.net    sh.oklaoshi.com  sh.oklaoshi.cn
    ServerAlias  nj.oklaoshi.org  nj.oklaoshi.net    nj.oklaoshi.com  nj.oklaoshi.cn
    ServerAlias  gz.oklaoshi.org  gz.oklaoshi.net    gz.oklaoshi.com  gz.oklaoshi.cn

    #               (   、  、  )
     RewriteEngine On
     RewriteOptions inherit

    #  shell        (                )
     PassEnv ENCRYPT_KEY

    #    PHP           
     php_admin_value open_basedir  "/www/oklaoshi/"
     php_admin_flag  file_uploads Off
     php_admin_value include_path  "/www/oklaoshi/secret"
     php_admin_value session.name  "OKLAOSHISESSIONID"
     php_admin_value session.referer_check  "oklaoshi."

    #        
     UnsetEnv  Local_Referer
    #         
     SetEnvIf Referer "oklaoshi\.(org|net|com|cn)" Local_Referer

  <Directory   "/www/oklaoshi/htdocs">
      Order Allow,Deny
      Allow from all
    #    (    <Directory>  )
    <FilesMatch "\.(js|css|gif|jpe?g|png|swf)$">
      Order Allow,Deny
      Allow from env=Local_Referer
    </FilesMatch>
  </Directory>

  #           (    )
  <Directory   "/www/oklaoshi/htdocs/root_admin">
    AuthName Root_Admin
    Require user Root_Admin
    Satisfy all
    Order Allow,Deny
    Allow from all
   #          
    RewriteEngine Off
  </Directory>

</VirtualHost>

<VirtualHost *:80>
#(        (phppgadmin))

  #      、      
   DocumentRoot /www/phppgadmin
    ServerName   dbadmin.oklaoshi.org
    ServerAlias  dbadmin.oklaoshi.net dbadmin.oklaoshi.com dbadmin.oklaoshi.cn

    #      
     RewriteEngine Off
    #        
     AddDefaultCharset Off
     LimitRequestBody 5242880
     DirectorySlash On
     DirectoryIndex index.html index.htm index.php

    #    PHP     
     php_admin_value  open_basedir "/www/phppgadmin"
     php_admin_flag   display_errors   Off
     php_admin_flag   display_startup_errors   Off
     php_admin_flag   html_errors   Off
    #php_admin_flag   log_errors   Off
     php_admin_value  max_execution_time   15
     php_admin_value  memory_limit   16M
     php_admin_value  max_input_time   600
     php_admin_value  max_input_nesting_level   32
     php_admin_value  post_max_size   4M
     php_admin_flag   file_uploads On
     php_admin_value  upload_max_filesize   4M
     php_admin_value  arg_separator.output  "&"
     php_admin_value  arg_separator.input   "&"
     php_admin_value  variables_order   "GPCS"
     php_admin_flag   implicit_flush    Off
     php_admin_value  output_buffering  8192
     php_admin_value  include_path  "."
     php_admin_value  default_charset   none
     php_admin_flag   detect_unicode   Off
     php_admin_value  ignore_user_abort  On
     php_admin_value  session.name  "DBADMINSESSIONID"
     php_admin_value  session.referer_check  "dbadmin.oklaoshi."
     php_admin_value  mbstring.func_overload   0

  <Directory   "/www/phppgadmin">
    AuthName DB_Admin
    Require user DB_Admin
    Satisfy all
    Order Allow,Deny
    Allow from all
  </Directory>

</VirtualHost>