Hello,
Am trying to use custom error pages in jira using apache(httpd) in redhat.
Please let me know how to do?
Thanks in advance
Please give me a reply to my last comment.
I followed How To Configure Apache to Use Custom Error Pages on CentOS 7 , it's working for 50* server errors but not 40* client errors in jira server. Still it redirects to jira default error pages.
will you please try to give more about this?
Fayaz
Hi Fayaz,
There is a way for you to customize these HTTP error code pages that Jira is using. Note this is a different approach than making changes to Apache. Jira uses a webserver called Tomcat to serve up it's web content. It is very common though that admins would utilize a proxy like apache, nginx, or IIS to redirect traffic. If you're still set on doing this in apache, I'd recommend checking out How To Configure Apache to Use Custom Error Pages on CentOS 7 It should be close enough to your Redhat that the steps would be pretty similar if not identical.
I found a related KB for the Crowd product in https://confluence.atlassian.com/crowdkb/how-to-customize-the-page-not-found-404-page-960724582.html
We can follow these similar steps for Jira:
Navigate to the following path on Jira Server.
<JIRA-install>/atlassian-jira/WEB-INF/web.xml
You will find that Jira already has error code pages defined for it, we need to tell this page where to look for our own custom html file. You can change the existing <error-code>404 tag for example, which has a default value of
<error-page>
<error-code>404</error-code>
<location>/secure/404.jspa</location>
</error-page>
and change this to be
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
Create a new file 404.html
under <jira-install>/atlassian-jira/
. We can use any HTML script like following to modify the custom page.
<!DOCTYPE html>
<html>
<body>
<p>Modified 404 page</p>
</body>
</html>
Restart Jira.
This would allow you to have Jira's native application serve up your own custom HTTP error pages if you wanted to. In turn I believe that these could still be used if you had a reverse proxy sitting in front of Jira as well.
This example just sets the 404 page. You could repeat these steps for all the different error codes you wanted to customize here.
I hope this helps.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Andy Heinzer
I followed How To Configure Apache to Use Custom Error Pages on CentOS 7 , it's working for 50* server errors but not 40* client errors in jira server. Still it redirects to jira default error pages.
will you please try to give more about this?
Fayaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fayaz,
It sounds like you will need to edit the web.xml file to achieve the customization you are looking for here. You could follow the steps I presented initially to create custom pages that Jira's Tomcat could host
OR
you could edit that web.xml file to comment out the <error-page> sets of tags entirely for the other error messages. Without these entries, perhaps your proxy can then display it's own error pages for those codes. I would expect that any changes made to that file in Jira would require a restart of Jira.
If that doesn't work, then perhaps it might help to try to follow the steps in How To Use the .htaccess File. This is another way to have your apache proxy configure this site to handle custom error page locations.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Andrew Heinzer,
Actually am following links to do through httpd, its working when jira is down/shutdown ie, custom 500 error page is getting,which is from redhat httpd. When jira is up, if we get 404 error, its getting jira's tomcat error page but not redhat httpd custom pages.
Please let me know, whether its work from httpd or not? If yes, how to do?
And also i found this link https://confluence.atlassian.com/kb/maintenance-page-for-jira-confluence-at-proxy-level-803931386.html. let me know how to do with mod_rewrite. Am not familiar with this.
Thanks in advance
fayaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.