Php 重写规则原因';请求超出了10个内部重定向的限制';
为什么Php 重写规则原因';请求超出了10个内部重定向的限制';,php,apache,.htaccess,Php,Apache,.htaccess,为什么.htaccess文件中的上述行会导致: RewriteRule ^([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/page_handler.php?handler=$1&page=$2 [QSA,L] 错误日志中的错误如下所示: 由于可能的原因,请求超出了10个内部重定向的限制 配置错误。使用“LimitInternalRecursion”增加 必要时限制。使用“日志级别调试”获取回溯 我在堆栈溢出上发现了很多帖子,但没有一个解决方案适合我。
.htaccess
文件中的上述行会导致:
RewriteRule ^([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/page_handler.php?handler=$1&page=$2 [QSA,L]
错误日志中的错误如下所示:
由于可能的原因,请求超出了10个内部重定向的限制
配置错误。使用“LimitInternalRecursion”增加
必要时限制。使用“日志级别调试”获取回溯
我在堆栈溢出上发现了很多帖子,但没有一个解决方案适合我。我有一个带cPanel的CentOS服务器。如果没有cPanel,这不会发生在我的服务器上。这是我的.htaccess文件:
<Files "htaccess_dist">
order allow,deny
deny from all
</Files>
Options -Indexes
Options +FollowSymLinks
DirectoryIndex index.php
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>
<FilesMatch "\.(jpg|jpeg|gif|png|mp3|flv|mov|avi|3pg|html|htm|swf|js|css|ico)$">
FileETag MTime Size
</FilesMatch>
<IfModule mod_php5.c>
php_value memory_limit 64M
php_value register_globals 0
php_value post_max_size 8388608
php_value upload_max_filesize 5242880
php_value display_errors 0
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on yes
mod_gzip_dechunk yes
mod_gzip_keep_workfiles No
mod_gzip_minimum_file_size 1000
mod_gzip_maximum_file_size 1000000
mod_gzip_maximum_inmem_size 1000000
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/javascript$
mod_gzip_item_include mime ^application/x-javascript$
# Exclude old browsers and images since IE has trouble with this
mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
mod_gzip_item_exclude mime ^image/.*
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.[0678] no-gzip
BrowserMatch \bMSIE !no-gzip
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
SetEnvIfNoCase Request_URI action\/* no-gzip dont-vary
SetEnvIfNoCase Request_URI actions\/* no-gzip dont-vary
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^pg\/([A-Za-z0-9\_\-]+)$ engine/handlers/page_handler.php?handler=$1&%{QUERY_STRING} [L]
RewriteRule ^pg\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/page_handler.php?handler=$1&page=$2&%{QUERY_STRING} [L]
RewriteRule ^tag\/(.+)\/?$ engine/handlers/page_handler.php?handler=search&page=$1 [L]
RewriteRule ^action\/([A-Za-z0-9\_\-\/]+)$ engine/handlers/action_handler.php?action=$1&%{QUERY_STRING} [L]
RewriteRule ^cache\/(.*)$ engine/handlers/cache_handler.php?request=$1&%{QUERY_STRING} [L]
RewriteRule ^services\/api\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/service_handler.php?handler=$1&request=$2&%{QUERY_STRING} [L]
RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/?$ engine/handlers/export_handler.php?view=$1&guid=$2 [L]
RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4 [L]
RewriteRule xml-rpc.php engine/handlers/xml-rpc_handler.php [L]
RewriteRule mt/mt-xmlrpc.cgi engine/handlers/xml-rpc_handler.php [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([A-Za-z0-9\_\-]+)$ engine/handlers/page_handler.php?handler=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/page_handler.php?handler=$1&page=$2 [QSA,L]
RewriteRule . /~user/sub/
</IfModule>
这是我的httpd.conf文件:
Include "/usr/local/apache/conf/includes/pre_main_global.conf"
Include "/usr/local/apache/conf/includes/pre_main_2.conf"
LoadModule bwlimited_module modules/mod_bwlimited.so
Include "/usr/local/apache/conf/php.conf"
Include "/usr/local/apache/conf/includes/errordocument.conf"
ErrorLog "logs/error_log"
DefaultType text/plain
ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi
ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
Alias /bandwidth /usr/local/bandmin/htdocs/
Alias /img-sys /usr/local/cpanel/img-sys/
Alias /java-sys /usr/local/cpanel/java-sys/
Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/
ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/
ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/
ScriptAlias /scgi-bin /usr/local/cpanel/cgi-sys/scgiwrap
<Directory "/">
Options All
AllowOverride All
</Directory>
<Directory "/usr/local/apache/htdocs">
Options Includes Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Files ~ "^error_log$">
Order allow,deny
Deny from all
Satisfy All
</Files>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog "logs/access_log" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
</IfModule>
<Directory "/usr/local/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_log_config.c>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log common
</IfModule>
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
PidFile logs/httpd.pid
LockFile logs/accept.lock
Listen 0.0.0.0:80
Listen [::]:80
User nobody
Group nobody
ExtendedStatus On
ServerAdmin user@gmail.com
ServerName wdsl.saptik.com
LogLevel debug
# These can be set in WHM under 'Apache Global Configuration'
Timeout 300
ServerSignature On
<IfModule prefork.c>
</IfModule>
<IfModule itk.c>
</IfModule>
RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
RewriteLock /usr/local/apache/logs/rewrite_lock
# Set UserDir directory for all virtual hosts, except..
UserDir public_html
# when the following two modules are loaded
<IfModule mod_ruid2.c>
UserDir disabled
</IfModule>
<IfModule itk.c>
UserDir disabled
</IfModule>
# DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority
DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html
# SSLCipherSuite can be set in WHM under 'Apache Global Configuration'
SSLPassPhraseDialog builtin
SSLSessionCache dbm:/usr/local/apache/logs/ssl_scache
SSLSessionCacheTimeout 300
SSLMutex file:/usr/local/apache/logs/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
Listen 0.0.0.0:443
Listen [::]:443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
AddHandler cgi-script .cgi .pl .plx .ppl .perl
AddHandler server-parsed .shtml
AddType text/html .shtml
AddType application/x-tar .tgz
AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlc .wmlc
AddType application/vnd.wap.wmlscriptc .wmlsc
<Location /whm-server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1 ::1
</Location>
# SUEXEC is supported
Include "/usr/local/apache/conf/includes/pre_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/pre_virtualhost_2.conf"
# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
NameVirtualHost 0.0.0.0:80
NameVirtualHost 127.0.0.1:80
NameVirtualHost *
# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
<VirtualHost 0.0.0.0:80>
ServerName 0.0.0.0
DocumentRoot /usr/local/apache/htdocs
ServerAdmin user@gmail.com
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
</VirtualHost>
# Default vhost for unbound IPs
<VirtualHost *>
ServerName wdsl.adomain.com
DocumentRoot /usr/local/apache/htdocs
ServerAdmin user@gmail.com
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
</VirtualHost>
# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
# SSL
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
<VirtualHost 0.0.0.0:80 127.0.0.1:80>
ServerName wdsl.adomain.com
ServerAlias cpanel.* whm.* webmail.* webdisk.*
DocumentRoot /usr/local/apache/htdocs
ServerAdmin user@gmail.com
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^cpanel\.
RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^webmail\.
RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^whm\.
RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^webdisk\.
RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
UseCanonicalName Off
</VirtualHost>
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
<VirtualHost 0.0.0.0:443 127.0.0.1:443>
ServerName wdsl.adomain.com
ServerAlias cpanel.* whm.* webmail.* webdisk.*
DocumentRoot /usr/local/apache/htdocs
ServerAdmin user@gmail.com
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
RewriteEngine On
<IfModule mod_ssl.c>
SSLEngine on
SSLProxyEngine On
SSLCertificateFile /var/cpanel/ssl/cpanel/cpanel.pem
SSLCertificateKeyFile /var/cpanel/ssl/cpanel/cpanel.pem
SSLCertificateChainFile /var/cpanel/ssl/cpanel/cpanel.pem
</IfModule>
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^cpanel\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^webmail\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^whm\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^webdisk\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
UseCanonicalName Off
</VirtualHost>
#JK
LoadModule jk_module modules/mod_jk.so
JKWorkersFile /usr/local/apache/conf/workers.properties
# Where to put jk logs
JKLogLevel debug
# Select the log format
JKLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JKOptions indicate to send SSL KEY SIZE
JKOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JKRequestLogFormat set the request format
JKRequestLogFormat "%w %V %T"
# Send all xhtml requests to Glassfish
JKMount /*.xhtml worker1
# Send all domain requests to Glassfish
JKMount /domain/* worker1
<VirtualHost 0.0.0.0:80>
ServerName sub.domain.com
ServerAlias www.sub.domain.com
DocumentRoot /home/sub/public_html/sub
ServerAdmin webmaster@sub.domain.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/sub.domain.com combined
CustomLog /usr/local/apache/domlogs/sub.domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User user # Needed for Cpanel::ApacheConf
UserDir enabled user
<IfModule mod_suphp.c>
suPHP_UserGroup user user
</IfModule>
<IfModule !mod_disable_suexec.c>
<IfModule !mod_ruid2.c>
SuexecUserGroup user user
</IfModule>
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid user user
</IfModule>
<IfModule itk.c>
# For more information on MPM ITK, please read:
# http://mpm-itk.sesse.net/
AssignUserID user user
</IfModule>
ScriptAlias /cgi-bin/ /home/user/public_html/sub/cgi-bin/
AccessFileName .htaccess
</VirtualHost>
<VirtualHost 0.0.0.0:80>
ServerAdmin admin@domain.com
ServerName domain.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://0.0.0.0:8080/
ProxyPassReverse / http://0.0.0.0:8080/
<Location />
Order allow,deny
Allow from all
</Location>
ErrorLog logs/glassfish-apache-error_log
CustomLog logs/glassfish-apache-access_log common
</VirtualHost>
Include "/usr/local/apache/conf/includes/post_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf"
Include”/usr/local/apache/conf/includes/pre_main_global.conf
Include“/usr/local/apache/conf/includes/pre_main_2.conf”
LoadModule bwlimited_module modules/mod_bwlimited.so
包括“/usr/local/apache/conf/php.conf”
Include“/usr/local/apache/conf/includes/errordocument.conf”
错误日志“日志/错误日志”
默认类型文本/纯文本
ScriptAliasMatch^/?控制面板/?$/usr/local/cpanel/cgi sys/redirect.cgi
ScriptAliasMatch^/?cpanel/?$/usr/local/cpanel/cgi sys/redirect.cgi
ScriptAliasMatch^/?kpanel/?$/usr/local/cpanel/cgi sys/redirect.cgi
ScriptAliasMatch^/?securecontrolpanel/?$/usr/local/cpanel/cgi sys/sredirect.cgi
ScriptAliasMatch^/?securecpanel/?$/usr/local/cpanel/cgi sys/sredirect.cgi
ScriptAliasMatch^/?securewhm/?$/usr/local/cpanel/cgi sys/swhmredirect.cgi
ScriptAliasMatch^/?webmail/?$/usr/local/cpanel/cgi sys/wredict.cgi
ScriptAliasMatch^/?whm/?$/usr/local/cpanel/cgi sys/whmredirect.cgi
别名/带宽/usr/local/bandmin/htdocs/
别名/img sys/usr/local/cpanel/img sys/
别名/java sys/usr/local/cpanel/java sys/
别名/mailman/archives/usr/local/cpanel/3rdparty/mailman/archives/public/
别名/pipermail/usr/local/cpanel/3rdparty/mailman/archives/public/
别名/sys\u cpanel/usr/local/cpanel/sys\u cpanel/
ScriptAlias/cgi sys/usr/local/cpanel/cgi sys/
ScriptAlias/mailman/usr/local/cpanel/3rdparty/mailman/cgi-bin/
ScriptAlias/scgi-bin/usr/local/cpanel/cgi-sys/scgiwrap
选项全部
允许超越所有
选项包括索引和符号链接
允许超越所有
命令允许,拒绝
通融
命令允许,拒绝
全盘否定
满足所有
命令允许,拒绝
全盘否定
满足所有
日志格式“%h%l%u%t\%r\”%>s%b\“%%{Referer}i\\\“%%{User Agent}i\\”组合
日志格式“%h%l%u%t\%r\”%>s%b”通用
自定义日志“日志/访问日志”通用
日志格式“%h%l%u%t\%r\”%>s%b\“%%{Referer}i\\“%%{User Agent}i\%i%O”组合IO
ScriptAlias/cgi-bin/“/usr/local/apache/cgi-bin/”
不允许超限
选项无
命令允许,拒绝
通融
日志格式“%h%l%u%t\%r\”%>s%b\“%%{Referer}i\\\“%%{User Agent}i\\”组合
日志格式“%h%l%u%t\%r\”%>s%b”通用
日志格式“%{Referer}i->%U”Referer
日志格式“%{User agent}i”代理
自定义日志/访问日志公用
TypesConfig conf/mime.types
AddType应用程序/x-compress.Z
AddType应用程序/x-gzip.gz.tgz
pid文件日志/httpd.pid
LockFile日志/accept.lock
听0.0.0.0:80
听[:]:80
用户无人
无人小组
扩展状态
服务器管理员user@gmail.com
ServerName wdsl.saptik.com
日志级调试
#这些可以在WHM中的“Apache全局配置”下设置
超时300
服务器签名
重新启动发动机
重写映射LeechProtect prg:/usr/local/cpanel/bin/LeechProtect
重写锁/usr/local/apache/logs/rewrite\u锁
#为所有虚拟主机设置UserDir目录,但。。
UserDir public_html
#加载以下两个模块时
UserDir已禁用
UserDir已禁用
#DirectoryIndex是通过WHM->Service Configuration->Apache Setup->DirectoryIndex Priority设置的
DirectoryIndex.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 default.html default.htm home.html
#SSLCipherSuite可以在WHM中的“Apache全局配置”下设置
SSLPassPhraseDialog内置
SSLSessionCache dbm:/usr/local/apache/logs/ssl\u scache
SSLSessionCacheTimeout 300
SSLMutex文件:/usr/local/apache/logs/ssl\u mutex
SSLR和OMSEED启动内置
SSLR和OMSEED连接内置
听0.0.0.0:443
听[:]:443
AddType应用程序/x-x509-ca-cert.crt
AddType应用程序/x-pkcs7-crl.crl
AddHandler cgi script.cgi.pl.plx.ppl.perl
AddHandler服务器已解析。shtml
AddType text/html.shtml
AddType应用程序/x-tar.tgz
AddType text/vnd.wap.wml.wml
AddType image/vnd.wap.wbmp.wbmp
AddType text/vnd.wap.wmlscript.wmls
AddType应用程序/vnd.wap.wmlc.wmlc
AddType应用程序/vnd.wap.wmlscript.wmlsc
SetHandler服务器状态
命令拒绝,允许
全盘否定
允许从127.0.0.1::1开始
#支持SUEXEC
Include“/usr/local/apache/conf/includes/pre_virtualhost_global.conf”
Include“/usr/local/apache/conf/includes/pre_virtualhost_2.conf”
#不要编辑。自动生成。如果您需要进行更改,请使用包含文件。
NameVirtualHost 0.0.0.0:80
NameVirtualHost 127.0.0.1:80
名称虚拟主机*
#不要编辑。自动生成。如果您需要进行更改,请使用包含文件。
服务器名0.0.0.0
DocumentRoot/usr/local/apache/htdocs
服务器管理员user@gmail.com
suPHP\u用户组无人无人无人
#未绑定IP的默认vhost
ServerName wdsl.adomain.com
DocumentRoot/usr/local/apache/htdocs
服务器管理员user@gmail.com
suPHP\u用户组无人无人无人
#不要编辑。自动生成。如果您需要进行更改,请使用包含文件。
#SSL
#CPANEL/WHM/WEBMAIL/WEBDISK代理子域
ServerName wdsl.adomain.com
ServerAlias cpanel.*whm.*webmail.*webdisk*
DocumentRoot/usr/local/apache/htdocs
服务器管理员user@gmail.com
suPHP_用户组
Include "/usr/local/apache/conf/includes/pre_main_global.conf"
Include "/usr/local/apache/conf/includes/pre_main_2.conf"
LoadModule bwlimited_module modules/mod_bwlimited.so
Include "/usr/local/apache/conf/php.conf"
Include "/usr/local/apache/conf/includes/errordocument.conf"
ErrorLog "logs/error_log"
DefaultType text/plain
ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi
ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
Alias /bandwidth /usr/local/bandmin/htdocs/
Alias /img-sys /usr/local/cpanel/img-sys/
Alias /java-sys /usr/local/cpanel/java-sys/
Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/
ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/
ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/
ScriptAlias /scgi-bin /usr/local/cpanel/cgi-sys/scgiwrap
<Directory "/">
Options All
AllowOverride All
</Directory>
<Directory "/usr/local/apache/htdocs">
Options Includes Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Files ~ "^error_log$">
Order allow,deny
Deny from all
Satisfy All
</Files>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog "logs/access_log" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
</IfModule>
<Directory "/usr/local/apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_log_config.c>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log common
</IfModule>
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
PidFile logs/httpd.pid
LockFile logs/accept.lock
Listen 0.0.0.0:80
Listen [::]:80
User nobody
Group nobody
ExtendedStatus On
ServerAdmin user@gmail.com
ServerName wdsl.saptik.com
LogLevel debug
# These can be set in WHM under 'Apache Global Configuration'
Timeout 300
ServerSignature On
<IfModule prefork.c>
</IfModule>
<IfModule itk.c>
</IfModule>
RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
RewriteLock /usr/local/apache/logs/rewrite_lock
# Set UserDir directory for all virtual hosts, except..
UserDir public_html
# when the following two modules are loaded
<IfModule mod_ruid2.c>
UserDir disabled
</IfModule>
<IfModule itk.c>
UserDir disabled
</IfModule>
# DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority
DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html
# SSLCipherSuite can be set in WHM under 'Apache Global Configuration'
SSLPassPhraseDialog builtin
SSLSessionCache dbm:/usr/local/apache/logs/ssl_scache
SSLSessionCacheTimeout 300
SSLMutex file:/usr/local/apache/logs/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
Listen 0.0.0.0:443
Listen [::]:443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
AddHandler cgi-script .cgi .pl .plx .ppl .perl
AddHandler server-parsed .shtml
AddType text/html .shtml
AddType application/x-tar .tgz
AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlc .wmlc
AddType application/vnd.wap.wmlscriptc .wmlsc
<Location /whm-server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1 ::1
</Location>
# SUEXEC is supported
Include "/usr/local/apache/conf/includes/pre_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/pre_virtualhost_2.conf"
# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
NameVirtualHost 0.0.0.0:80
NameVirtualHost 127.0.0.1:80
NameVirtualHost *
# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
<VirtualHost 0.0.0.0:80>
ServerName 0.0.0.0
DocumentRoot /usr/local/apache/htdocs
ServerAdmin user@gmail.com
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
</VirtualHost>
# Default vhost for unbound IPs
<VirtualHost *>
ServerName wdsl.adomain.com
DocumentRoot /usr/local/apache/htdocs
ServerAdmin user@gmail.com
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
</VirtualHost>
# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
# SSL
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
<VirtualHost 0.0.0.0:80 127.0.0.1:80>
ServerName wdsl.adomain.com
ServerAlias cpanel.* whm.* webmail.* webdisk.*
DocumentRoot /usr/local/apache/htdocs
ServerAdmin user@gmail.com
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^cpanel\.
RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^webmail\.
RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^whm\.
RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^webdisk\.
RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
UseCanonicalName Off
</VirtualHost>
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
<VirtualHost 0.0.0.0:443 127.0.0.1:443>
ServerName wdsl.adomain.com
ServerAlias cpanel.* whm.* webmail.* webdisk.*
DocumentRoot /usr/local/apache/htdocs
ServerAdmin user@gmail.com
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
RewriteEngine On
<IfModule mod_ssl.c>
SSLEngine on
SSLProxyEngine On
SSLCertificateFile /var/cpanel/ssl/cpanel/cpanel.pem
SSLCertificateKeyFile /var/cpanel/ssl/cpanel/cpanel.pem
SSLCertificateChainFile /var/cpanel/ssl/cpanel/cpanel.pem
</IfModule>
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^cpanel\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^webmail\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^whm\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
RewriteCond %{HTTP_HOST} !^wdsl.adomain.com$
RewriteCond %{HTTP_HOST} ^webdisk\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
UseCanonicalName Off
</VirtualHost>
#JK
LoadModule jk_module modules/mod_jk.so
JKWorkersFile /usr/local/apache/conf/workers.properties
# Where to put jk logs
JKLogLevel debug
# Select the log format
JKLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JKOptions indicate to send SSL KEY SIZE
JKOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JKRequestLogFormat set the request format
JKRequestLogFormat "%w %V %T"
# Send all xhtml requests to Glassfish
JKMount /*.xhtml worker1
# Send all domain requests to Glassfish
JKMount /domain/* worker1
<VirtualHost 0.0.0.0:80>
ServerName sub.domain.com
ServerAlias www.sub.domain.com
DocumentRoot /home/sub/public_html/sub
ServerAdmin webmaster@sub.domain.com
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/sub.domain.com combined
CustomLog /usr/local/apache/domlogs/sub.domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User user # Needed for Cpanel::ApacheConf
UserDir enabled user
<IfModule mod_suphp.c>
suPHP_UserGroup user user
</IfModule>
<IfModule !mod_disable_suexec.c>
<IfModule !mod_ruid2.c>
SuexecUserGroup user user
</IfModule>
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid user user
</IfModule>
<IfModule itk.c>
# For more information on MPM ITK, please read:
# http://mpm-itk.sesse.net/
AssignUserID user user
</IfModule>
ScriptAlias /cgi-bin/ /home/user/public_html/sub/cgi-bin/
AccessFileName .htaccess
</VirtualHost>
<VirtualHost 0.0.0.0:80>
ServerAdmin admin@domain.com
ServerName domain.com
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://0.0.0.0:8080/
ProxyPassReverse / http://0.0.0.0:8080/
<Location />
Order allow,deny
Allow from all
</Location>
ErrorLog logs/glassfish-apache-error_log
CustomLog logs/glassfish-apache-access_log common
</VirtualHost>
Include "/usr/local/apache/conf/includes/post_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf"
RewriteRule ^engine/handlers/page_handler.php - [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([A-Za-z0-9\_\-]+)$ engine/handlers/... [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/... [QSA,L]
RewriteRule . /~gesht/companion/
...[QSA,L,E=LOOP:1]
# if LOOP is set...
RewriteCond %{ENV:LOOP} =1
# ...then no-rewrite and quit.
RewriteRule .* - [L]
# All others rules follow.
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^ - [L]
<base href="/" />