掲示板

HTTP Errors - 500, 404, etc

17年前 に Matthew Ellis によって更新されました。

HTTP Errors - 500, 404, etc

Junior Member 投稿: 36 参加年月日: 06/09/04 最新の投稿
Hi guys,

When using Liferay portal in production environment you do not want to be exposing things like stracktraces to end clients because this is a security risk as well as user experience issue.

How does Liferay handle this problem? I know I can go in and edit the web.xml and add <error-page> elements, is this the recommended approach? Or is there a better way of doing this?

Cheers,
Matt.
thumbnail
17年前 に Tuan Anh Nguyen によって更新されました。

RE: HTTP Errors - 500, 404, etc

New Member 投稿: 5 参加年月日: 07/01/29 最新の投稿
Hi Matthew,

I've got the same problem as you, and I decide to solve it as follow:

As you know, 4xx error codes imply the errors caused by client, and 5xx error codes imply the errors caused by server. So, to do this, I gotta make changes to both the Servlet container(Tomcat) and Webserver(Apache). In Tomcat, add the following elements under the web-app element:


	<error-page>
		<error-code>404</error-code>
		<location>/error_page.htm</location>
	</error-page>
        ...


And in Apache, you need to be considerate with the 5xx error codes.

Hope to see a better approach from you.
17年前 に Matthew Ellis によって更新されました。

RE: HTTP Errors - 500, 404, etc

Junior Member 投稿: 36 参加年月日: 06/09/04 最新の投稿
Yeah that is what I have had to do as well, not the most ideal solution because each time I upgrade I need to remember to copy the pages and the XML config over as well....Liferay guys, any thoughts?
thumbnail
17年前 に Michael Young によって更新されました。

RE: HTTP Errors - 500, 404, etc

Liferay Master 投稿: 846 参加年月日: 04/08/05 最新の投稿
In which cases do you see these errors? I'm sure we can catch these and display something else to the user.
17年前 に Matthew Ellis によって更新されました。

RE: HTTP Errors - 500, 404, etc

Junior Member 投稿: 36 参加年月日: 06/09/04 最新の投稿
I have a screenshot here, trying to attach it now...can't see how to do this anymore. Has this been turned off?
thumbnail
17年前 に Tuan Anh Nguyen によって更新されました。

RE: HTTP Errors - 500, 404, etc

New Member 投稿: 5 参加年月日: 07/01/29 最新の投稿
Michael Young:
In which cases do you see these errors? I'm sure we can catch these and display something else to the user.


Hi Michael,

In case of 4xx error, I agree with you that we can catch and hide them behind the page, but we will have to make changes to the Liferay core, say, the MainServlet class. However, in such cases of 5xx error, there's no ways else but configuring the web server to be responsible for.

Regards,
thumbnail
10年前 に Nitesh Sahay によって更新されました。

RE: HTTP Errors - 500, 404, etc

Junior Member 投稿: 58 参加年月日: 11/11/28 最新の投稿
Is there any way to implements the redirection on 500 http error to custom error page in liferay 6.1.1 CE GA2 ?
10年前 に Stephane real によって更新されました。

RE: HTTP Errors - 500, 404, etc

New Member 投稿: 5 参加年月日: 13/12/06 最新の投稿
Maybe is related to the portal-ext.properties :
For liferay 5 version : permissions.user.check.algorithm=5
For liferay 6 version : permissions.user.check.algorithm=6