[Building Sakai] custom 403 and 404 pages

Matthew Jones jonespm at umich.edu
Thu Aug 5 08:11:59 PDT 2010


Also, if you're running apache (or something) in front of your tomcat with
mod_jk or ajp [1], I think you have to put these in the VirtualHost in
there. Then they can point to anywhere that's under the defined DocumentRoot
or a URL.[2]. Actually seems a bit easier.

        ErrorDocument 503 /ROOT/error-pages/503.html
        ErrorDocument 404 /ROOT/error-pages/404.html
        ErrorDocument 403 /ROOT/error-pages/403.html

[1]
http://confluence.sakaiproject.org/display/DOC/Sakai+Admin+Guide+-+Advanced+Tomcat++(and+Apache)+Configuration
[2] http://httpd.apache.org/docs/2.0/mod/core.html#errordocument

-Matthew

On Thu, Aug 5, 2010 at 11:05 AM, <mizematr at notes.udayton.edu> wrote:

>
> I did this a while back thanks to this thread: http://tinyurl.com/d9f5en
> ---------------------------------------------------------------------------
> Matt Mize, Systems Administrator
> - Pay no attention to the man in the back office....
> Matt.Mize at notes.udayton.edu
> (937) 229-1024
>
> UDit Department, University of Dayton
> 300 College Park, Dayton, OH, 45469-1302
>
>
>    *[Building Sakai] custom 403 and 404 pages*
>  *Nicola Monat-Jacobs * to: sakai-dev List
> 08/04/10 11:52 AM
>
>    Sent by: *sakai-dev-bounces at collab.sakaiproject.org* Cc: John Ansorge
>
>
>
> ------------------------------
> <http://tinyurl.com/d9f5en>
> <http://tinyurl.com/d9f5en>
>
>
>
> I did a little bit of googling and wasn't able to find anything, so I
> thought I'd post to the list.
>
> We'd like to implement custom 403 and 404 pages in a Sakai 2.6 instance to
> make the user experience a little bit better. Tomcat allows you to specify
> these custom pages in the main web.xml, however, it appears that if you
> configure this, you don't capture all the 403 and 404 possibilities.
>
> The following url will bring up the custom 404 page:
> <http://tinyurl.com/d9f5en>*https://sakai.longsight.com/blarg*<https://sakai.ohsu.edu/blarg%29>
>
> <https://sakai.ohsu.edu/blarg%29>But these urls will default to the
> standard 404 page:*
> **https://* <https://sakai.longsight.com/access/blarg>*sakai.longsight.com
> * <https://sakai.ohsu.edu/blarg%29>/access/blarg*
> **https://* <https://sakai.ohsu.edu/library/blarg%29.>*sakai.longsight.com
> * <https://sakai.ohsu.edu/blarg%29>/library/blarg
>
> To quote from John Ansorge of OHSU who has also been working on the issue:
>
> The Sakai tools are looking for the 404 and 403 pages within their own
> webapp contexts. So, if you've configured conf/web.xml like this:
>
> 404
> /404.htm
>
> Then /library/ will look for the file in /webapps/library/404.htm. I
> put the 404.htm file in /webapps/library/404.htm on our test server and
> it worked.
>
> However, if you visit
> /access/blarg, it will look for the error page in Sakai's resources. I
> tweaked the /webapps/access/WEB-INF/web.xml like so,
>
> 404
> /content/public/error404.htm
>
> restarted, and uploaded an "error404.htm" page into the public folder in
> the admin panel, and the error404.htm page showed when I went to
> /access/blarg in my browser.
>
> I looked, but didn't find any way to configure the parameter
> in web.xml to use the absolute root of the host instead of the webapp
> root. That makes customizing the 404 and 403 messages kinda ugly,
> really, since it would mean strewing 404.htm files in each and every
> tool.
>
> Anyone have any recommendations on how to address this? Otherwise, I'll
> make a feature request JIRA that this be a configurable setting.
>
> Thanks,
> Nicola_______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
> with a subject of "unsubscribe"<http://collab.sakaiproject.org/mailman/listinfo/sakai-dev>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100805/3b8eb9cc/attachment.html 


More information about the sakai-dev mailing list