我剛剛從2.2更新了Apache到2.4。但是我的Apache設置不適用於我的本地計算機上的我的網站。下面是詳細信息Apache配置在本地機器上的Ubuntu 14.04
<VirtualHost www.letscompete.it:80>
ServerName www.letscompete.it
DocumentRoot /opt/content/letscompete-content/velocity/static/
ProxyRequests Off
ProxyPreserveHost On
ProxyVia On
ProxyTimeout 1000
TimeOut 1000
# Proxy requests to the java application
# trailing slash required at the end of context path or will end up in a redirect loop
ProxyPass/ajp://localhost:8009/letscompete/
# Revrites http headers (Location, Content-Location, URI)
# on http redirect responses to avoid bypassing this gateway
# in redirects coming from the web application
# no trailing slash at the end of context path (optional)
ProxyPassReverse/ajp://localhost:8009/letscompete
# Adjusts the Path string in Set-Cookie headers
# NOTE: no trailing slash at the end of context path or will have redirect (302) issues after authentication
ProxyPassReverseCookiePath /letscompete/
# Filters output HTML to convert the context path
# generated from the proxyied server to the one
# on this proxy
SetOutputFilter proxy-html
# NOTE: trailing slash required at the end of context path or links will be generated without the context
ProxyHTMLURLMap /letscompete//
ProxyHTMLDocType "<!DOCTYPE html>"
AllowEncodedSlashes On
RewriteEngine On
RewriteRule ^/favicon.ico$ /images/favicon.ico [NC,L]
RewriteRule ^/bootshop/(.*)$ /bootshop/$1 [QSA,NC,L]
RewriteRule ^/less/(.*)$ /less/$1 [QSA,NC,L]
RewriteRule ^/css/(.*)$ /css/$1 [NC,L]
RewriteRule ^/img/(.*)$ /img/$1 [NC,L]
RewriteRule ^/images/(.*)$ /images/$1 [NC,L]
RewriteRule ^/js/(.*)$ /js/$1 [NC,L]
RewriteRule ^/font/(.*)$ /font/$1 [QSA,NC,L]
RewriteRule ^/letscompete/(.*)$ /$1 [R]
<Directory "/opt/content/FindBlog-content/velocity/static/">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
<Proxy ajp://localhost:8009>
Order allow,deny
Allow from all
Require all granted
</Proxy>
每當我打這個地址的服務器引發錯誤:
Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
我啓用了以下模式:
access_compat別名auth_basic authn_core authn_file authz_core authz_host authz_user自動變址放氣dir env filter mime mpm_event協商代理proxy_ajp proxy_express proxy_html proxy_scgi proxy_wstunnel重寫setenvif狀態xml2enc
這是我的錯誤日誌:
[Sat Nov 21 10:49:29.130742 2015] [proxy_ajp:error] [pid 1833:tid 140289415259904] (104)Connection reset by peer: AH01030: ajp_ilink_receive() can't receive header
[Sat Nov 21 10:49:29.130904 2015] [proxy_ajp:error] [pid 1833:tid 140289415259904] [client 127.0.0.1:45935] AH00992: ajp_read_header: ajp_ilink_receive failed
[Sat Nov 21 10:49:29.130920 2015] [proxy_ajp:error] [pid 1833:tid 140289415259904] (120006)APR does not understand this error code: [client 127.0.0.1:45935] AH00878: read response failed from
127.0.0.1:8009 (localhost)
[Sat Nov 21 10:49:31.731353 2015] [proxy:error] [pid 1832:tid 140289318573824] AH00940: AJP: disabled connection for (localhost)
[Sat Nov 21 10:49:32.604179 2015] [proxy:error] [pid 1833:tid 140289310181120] (111)Connection refused: AH00957: AJP: attempt to connect to 127.0.0.1:8009 (localhost) failed
[Sat Nov 21 10:49:32.604230 2015] [proxy:error] [pid 1833:tid 140289310181120] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 60s
[Sat Nov 21 10:49:32.604244 2015] [proxy_ajp:error] [pid 1833:tid 140289310181120] [client
127.0.0.1:45948] AH00896: failed to make connection to backend: localhost
[Sat Nov 21 10:49:33.322966 2015] [proxy:error] [pid 1833:tid 140289301788416] AH00940: AJP: disabled connection for (localhost)
[Sat Nov 21 10:49:39.384979 2015] [proxy:error] [pid 1833:tid 140289293395712] AH00940: AJP: disabled connection for (localhost)
至於我的hosts文件:
127.0.0.1 localhost
127.0.1.1 www.letscompete.it