# UTF-8 encoding
### 此份配置只用于开发环境,产品环境与之不同的地方会有相应说明
##########################################################################################
### mpm_prefork ###
Listen 80 http
ListenBacklog 255
MaxMemFree 0
MaxRequestsPerChild 10000
PidFile /var/run/httpd.pid
ReceiveBufferSize 11840
SendBufferSize 11840
AcceptMutex posixsem
LockFile /tmp/httpd_accept.lock
#仅在编译时明确使用了 --enable/disable-exception-hook 选项的情况下才可用
#EnableExceptionHook Off
GracefulShutDownTimeout 300
Group www
User httpd
MaxClients 5
ServerLimit 5
StartServers 3
MaxSpareServers 3
MinSpareServers 1
##下面这些对应产品环境
#MaxClients 1000
#ServerLimit 1000
#StartServers 30
#MaxSpareServers 30
#MinSpareServers 15
### mod_so ###
#产品环境不加载 info 模块,ssl模块可以根据实际情况选用,此配置未使用
LoadModule info_module /lib/apache/mod_info.so
#LoadModule ssl_module /lib/apache/mod_ssl.so
LoadModule php5_module /lib/apache/libphp5.so
PHPINIDir /etc
AddType application/x-httpd-php .php .htm
##### (Core) #####
LimitRequestFields 20
LimitRequestFieldSize 3000
LimitRequestLine 1020
NameVirtualHost *:80
ServerRoot /share/empty
ServerTokens Prod
TimeOut 15
TraceEnable off
##### (mod_mime) #####
TypesConfig /etc/apache/mime.types
AuthDigestShmemSize 25600
BufferedLogs Off
##### (mod_status) #####
ExtendedStatus On
################################################################################################
##### (Core) #####
ServerName xx.xx.xx.xx
AccessFileName .htaccess
Options FollowSymLinks
AddDefaultCharset utf-8
DefaultType application/octet-stream
ContentDigest Off
FileETag All
AcceptPathInfo Off
AllowEncodedSlashes Off
LimitInternalRecursion 10
LimitRequestBody 1300000
LimitXMLRequestBody 1300000
RLimitCPU 1 1
RLimitMEM 1 1
RLimitNPROC 0 1
ServerSignature Off
EnableMMAP On
EnableSendfile On
HostnameLookups Off
KeepAlive Off
KeepAliveTimeout 1
MaxKeepAliveRequests 1
ErrorDocument 400 /error/http|ErrCode=400.htm
ErrorDocument 403 /error/http|ErrCode=403.htm
ErrorDocument 404 /error/http|ErrCode=404.htm
ErrorDocument 405 /error/http|ErrCode=405.htm
ErrorDocument 406 /error/http|ErrCode=406.htm
ErrorDocument 408 /error/http|ErrCode=408.htm
ErrorDocument 409 /error/http|ErrCode=409.htm
ErrorDocument 410 /error/http|ErrCode=410.htm
ErrorDocument 411 /error/http|ErrCode=411.htm
ErrorDocument 411 /error/http|ErrCode=412.htm
ErrorDocument 413 /error/http|ErrCode=413.htm
ErrorDocument 414 /error/http|ErrCode=414.htm
ErrorDocument 415 /error/http|ErrCode=415.htm
ErrorDocument 416 /error/http|ErrCode=416.htm
ErrorDocument 417 /error/http|ErrCode=417.htm
ErrorDocument 423 /error/http|ErrCode=423.htm
ErrorDocument 500 /error/http|ErrCode=500.htm
ErrorDocument 501 /error/http|ErrCode=501.htm
ErrorDocument 502 /error/http|ErrCode=502.htm
ErrorDocument 503 /error/http|ErrCode=503.htm
ErrorDocument 504 /error/http|ErrCode=504.htm
#ErrorDocument 505 /error/http|ErrCode=505.htm
ServerAdmin webmaster@oklaoshi.org
ErrorLog "|/bin/rotatelogs /var/log/apache/error-%M.log 600"
#产品环境切换时间为24小时
#ErrorLog "|/bin/rotatelogs /var/log/apache/error-%d.log 86400"
LogLevel info
#建议产品环境使用warn
#LogLevel warn
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
UseCanonicalName Off
UseCanonicalPhysicalPort Off
#### mod_deflate ####
DeflateBufferSize 20240
DeflateCompressionLevel 4
DeflateMemLevel 9
DeflateWindowSize 15
#### mod_dir ####
DirectorySlash Off
DirectoryIndex xxxxxxxxxxx
##建议产品环境使用如下设置
#DirectorySlash On
#DirectoryIndex index.html index.htm index.php
#### mod_env mod_setenvif mod_log_config #####
UnsetEnv AccessLog
SetEnvIf Request_URI "\.(txt|php|html?)$" AccessLog=1
CustomLog "|/bin/rotatelogs /var/log/apache/access-%M.log 600" "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" env=AccessLog
#产品环境切换时间为24小时
#CustomLog "|/bin/rotatelogs /var/log/apache/access-%d.log 86400" "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" env=AccessLog
##### mod_expires #####
ExpiresActive On
ExpiresDefault "access plus 30 days"
ExpiresActive Off
##### mod_mime #####
DefaultLanguage zh-CN
MultiviewsMatch NegotiatedOnly
##### mod_rewrite #####
RewriteEngine Off
RewriteLogLevel 0
RewriteCond %{REQUEST_URI} \.htm$
RewriteRule ^(.+)\.htm$ $1.php [NE,C]
RewriteRule ^([^|]+)\|(.+)\.php$ $1.php?$2 [NE,L]
################################################################################################
AllowOverride None
Options FollowSymLinks
Satisfy all
AuthType Digest
AuthDigestAlgorithm MD5
AuthDigestNonceLifetime 1200
AuthDigestQop auth
AuthDigestProvider file
AuthDefaultAuthoritative On
AuthUserFile /etc/apache/authn.md5
AuthzUserAuthoritative On
AuthzDefaultAuthoritative On
Deny from all
Order Allow,Deny
AllowOverride None
Options FollowSymLinks
Satisfy all
Deny from all
Order Allow,Deny
############################################################################
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
#PassEnv ENCRYPT_KEY
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
Order Allow,Deny
Allow from all
Order Allow,Deny
Allow from env=Local_Referer
## 服务器配置报告,密码与用户名相同
SetHandler server-info
AuthName Apache_Admin
Require user Apache_Admin
Satisfy all
Order Allow,Deny
Allow from all
## 服务器状态报告,密码与用户名相同
SetHandler server-status
AuthName Apache_Admin
Require user Apache_Admin
Satisfy all
Order Allow,Deny
Allow from all
############################################################################
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
PassEnv ENCRYPT_KEY
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
Order Allow,Deny
Allow from all
Order Allow,Deny
Allow from env=Local_Referer
##网站根用户后台管理目录,密码与用户名相同
AuthName Root_Admin
Require user Root_Admin
Satisfy all
Order Allow,Deny
Allow from all
RewriteEngine Off
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
##密码与用户名相同
AuthName DB_Admin
Require user DB_Admin
Satisfy all
Order Allow,Deny
Allow from all