WEB/web, was
[Apache/Websphere/Tomcat] 에러 페이지 설정
JJunDol2
2020. 9. 30. 11:46
Apache 에러 페이지 설정
1. error.html 이름으로 원하는 에러 페이지를 만들고 서버의 특정 경로에 업로드
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ERROR</title>
</head>
<body>
<h1>ERROR</h1>
</body>
</html>
2. httpd.conf 설정
Alias /error/ "에러페이지가 있는 서버경로"
ErrorDocument 404 /error/error.html
ErrorDocument 403 /error/error.html
3. apache 재시작
Websphere 에러 페이지 설정
1. error.jsp 만들기
2. web.xml, web_merged.xml 설정
경로 : WebSphere/AppServer/profiles/<AppSrv01>/config/cells/<cell_name>/applications/<ear_name>/deployments/<app_name>/<war_name>/WEB-INF
* 다른 WAS는 어플리케이션에 직접 속해있는 web.xml을 수정하면 되는데, WebSphere는 실제 WebSphere가 설치된 디렉터리 안에 있는 web.xml, web_merged.xml을 수정해야 반영됨
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
3. WebSphere 재시작
Tomcat 에러 페이지 설정
1. error.jsp
2. web.xml설정
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
3. Tomcat 재시작