2010-11-21 4 views
2

Tomcat 6.0.18에서 실행중인 웹 응용 프로그램에서 작업 중이며 Apache 2를 역방향 프록시로 사용하고 있습니다. 이것은 잘 작동합니다. 예를 들어 재배포를 위해 Tomcat을 종료했을 때 Apache가 오류 페이지를 표시하도록하려고합니다. 그러나 httpd.conf의 ErrorDocument 지시문은 로컬 파일에 대해 전혀 작동하지 않습니다. 나는 외부 urls 및 문자열을 시도하고 두 경우 모두 정상적으로 작동합니다. 하지만 아래 작동하지 않습니다 :ErrorDocument가 로컬 파일과 작동하지 않습니다.

ErrorDocument 403 /Oops.html 
ErrorDocument 404 /Oops.html 
ErrorDocument 502 /Oops.html 
ErrorDocument 503 /Oops.html 

Oops.html 파일은 내 htdocs 폴더에 있습니다. 내가 htaccess로 파일을 사용하지 않는

==> access_log <== 
localhost - - [21/Nov/2010:12:23:36 -0800] "GET /home HTTP/1.1" 503 - 

==> error_log <== 
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy_http.c(54): proxy: HTTP: canonicalising URL //localhost:8080/home 
[Sun Nov 21 12:23:36 2010] [debug] proxy_util.c(1412): [client ::1] proxy: http: found worker http://localhost:8080/ for http://localhost:8080/home 
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy.c(819): Running scheme http handler (attempt 0) 
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy_http.c(1693): proxy: HTTP: serving URL http://localhost:8080/home 
[Sun Nov 21 12:23:36 2010] [debug] proxy_util.c(1790): proxy: HTTP: retrying the worker for (localhost) 
[Sun Nov 21 12:23:36 2010] [error] proxy: HTTP: disabled connection for (localhost) 
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy_http.c(54): proxy: HTTP: canonicalising URL //localhost:8080/Oops.html 
[Sun Nov 21 12:23:36 2010] [debug] proxy_util.c(1412): [client ::1] proxy: http: found worker http://localhost:8080/ for http://localhost:8080/Oops.html 
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy.c(819): Running scheme http handler (attempt 0) 
[Sun Nov 21 12:23:36 2010] [debug] mod_proxy_http.c(1693): proxy: HTTP: serving URL http://localhost:8080/Oops.html 
[Sun Nov 21 12:23:36 2010] [debug] proxy_util.c(1790): proxy: HTTP: retrying the worker for (localhost) 
[Sun Nov 21 12:23:36 2010] [error] proxy: HTTP: disabled connection for (localhost) 

참고 : 다음은 Tomcat이 실행되지 않고 아파치가 때 앱에 접근하려고 아파치에서 일부 로그 출력됩니다. htdocs 폴더와 관련된 설정에 문제가있는 것 같습니다. 아래는 htdocs 폴더와 관련이있는 내 httpd.conf 파일의 일부 비트입니다. 나는 Apache와 협력하는 데있어 새로운데, 이것이 얼마나 관련성이 있는지 또는 더 게시해야하는지 잘 모르겠습니다.

<Directory "/usr/local/apache2/htdocs"> 
    Options Indexes FollowSymLinks 
    AllowOverride None 
    Order allow,deny 
    Allow from all  
</Directory> 

도움이 되었습니까?

편집 :

Tomcat이 나는 오류 로그에 다음 줄 참조 실행 :

[Sun Nov 21 13:30:11 2010] [error] [client ::1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3046): [client ::1] r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri = /Oops.html 
[Sun Nov 21 13:30:11 2010] [debug] core.c(3052): [client ::1] redirected from r->uri =/

뭔가가 제대로 구성되지 않습니다하지만 난 아무 나는이 없다 무엇을 어디서. 지금까지의 답변에 감사하지만 여전히 혼란 스럽습니다.

+0

당신은 아마 더 트리 위쪽 또는 구성의 디렉토리에 라인을 따라 어딘가 약간의 RewriteRules이 있습니까? .... 두 번째 생각에도 불구하고 이것은 404 문서를 찾지 못하고 404 문서를 찾지 못하는 등 재귀가 될 수 있습니다. –

+0

check가'DocumentRoot' +'/Ops.html'='/ usr/local/apache2/htdocs/Ops.html'? 친절한 당신이 다른 DocumentRoot를 사용하고 있다고 생각합니다. – ajreal

+0

@ajreal : 모든 프록시 기능을 비활성화하고 오류 문서 지시문을 제거하고 다시 시작했습니다. DocumentRoot로 설정 한 디렉토리의 다른 몇 페이지에 액세스 할 수 있었으므로 올바르게 설정되어있는 것으로 보입니다. – richever

답변

0

중앙 구성에서 지정된 경우 Apache는 경로를 절대 경로로 처리하여 루트 디렉토리에서 Oops.html을 찾습니다. 전체 경로를 사용해보십시오 :

ErrorDocument 403 /usr/local/apache2/htdocs/Oops.html 

또한, 난 당신이 VirtualHost 섹션에 넣어 경우, 상대적으로 작동합니다 같아요.

ErrorDocument docs

+0

나는 당신의 제안을 모두 시도해 보았습니다. 그리고 나는 여전히 아무것도 얻지 못했습니다. 그래도 고마워. – richever

+0

@richever strange. 웹 서버에 파일을 읽을 수있는 권한이 있습니까? –

+0

나는 그 디렉토리에있는 다른 파일들을 시도해 보았고 chmod를 사용하여 액세스 할 수 있어야했지만 여전히 아무것도 필요가 없었다. 일부 잘못된 구성을 가리키는 오류 로그에 의심스러운 라인을 언급하기 위해 내 게시물을 편집 할 것입니다. – richever

1

에 AllowOverride가 없음 수 없습니다 안

+0

구성에 이미 설정되어 있습니까? –

관련 문제