Author Topic: How to change error page  (Read 13826 times)

HANNES1985

  • Zen Warrior
  • ***
  • Posts: 141
  • Karma: +0/-0
    • View Profile
    • CSIWISP
How to change error page
« on: February 23, 2010, 04:58:19 pm »
Hi guys Id like to know if its possible to change the error page in my server say to put my logo at the top and change the background color as well as the  webmaster link at the bottom to send mail to my servers email address (admin@whatever .com)
Only people that wants to no more will ask!!

doperst

  • Zen Apprentice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: How to change error page
« Reply #1 on: March 18, 2010, 05:43:40 pm »
Sorry for hijacking the thread, i have the same question:

How do i customize Proxy Filter "this page has been blocked" page?
I think you meant the same?

HANNES1985

  • Zen Warrior
  • ***
  • Posts: 141
  • Karma: +0/-0
    • View Profile
    • CSIWISP
Re: How to change error page
« Reply #2 on: March 18, 2010, 05:51:32 pm »
No Problem

And yes that is what I meant well all the "problems" get directed to one .php page the .php engine just explains exactly what the cause is (if I'm not mistaken) in the bold letters

Only people that wants to no more will ask!!

Sam Graf

  • Guest

HANNES1985

  • Zen Warrior
  • ***
  • Posts: 141
  • Karma: +0/-0
    • View Profile
    • CSIWISP
Re: How to change error page
« Reply #4 on: March 18, 2010, 09:39:39 pm »
Quote
See http://contentfilter.futuragts.com/wiki/doku.php?id=template_customization

It is there but my server doesn't use these templates given in the dansgaurdian directory

The page I want to change is the page you get when the proxy deny a certain request given by the client which is blocked by the filter on my server (maybe this will shed some light on this matter)

I found some pages in /usr/share/apache2/error/include and this is defenetly the pages I want to edit but it has a script in and im afraid it might not work if I edit it directly

This is the code In it

<!--#if expr="! $CONTENT_LANGUAGE"
--><!--#set var="CONTENT_LANGUAGE" value="en"
--><!--#endif
--><!--#if expr="! $CHARACTER_ENCODING"
--><!--#set var="CHARACTER_ENCODING" value="ISO-8859-1"
--><!--#endif
--><?xml version="1.0" encoding="<!--#echo var="CHARACTER_ENCODING" -->"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<!--#echo var="CONTENT_LANGUAGE" -->" xml:lang="<!--#echo var="CONTENT_LANGUAGE" -->">
<head>
<title><!--#echo encoding="none" var="TITLE" --></title>
<link rev="made" href="mailto:<!--#echo encoding="url" var="SERVER_ADMIN" -->" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1><!--#echo encoding="none" var="TITLE" --></h1>
<p>


Can I change the highlighted parts to what I want without effecting the page so the whole page doesn't work
Only people that wants to no more will ask!!

Sam Graf

  • Guest
Re: How to change error page
« Reply #5 on: March 18, 2010, 09:56:45 pm »
Sorry, I thought you were talking about the standard eBox "access denied" page served by DansGuardian which does use the template and is the only document I've ever had to edit to customize content filter denial responses. Squid response pages and/or Apache error pages are not something I've ever changed on an eBox install.

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
Re: How to change error page
« Reply #6 on: March 19, 2010, 12:29:42 pm »
Yes, dansguardian and squid use different fiels tempaltes.
The squid templates are located at /usr/share/squid/errors , there is a subdirectory for each language

HANNES1985

  • Zen Warrior
  • ***
  • Posts: 141
  • Karma: +0/-0
    • View Profile
    • CSIWISP
Re: How to change error page
« Reply #7 on: March 19, 2010, 02:24:54 pm »
Quote
Yes, dansguardian and squid use different fiels tempaltes.
The squid templates are located at /usr/share/squid/errors , there is a subdirectory for each language
Can I edit these HTML documents in a editing program (which will most probably change the code and or layout)and this service will still work?
Only people that wants to no more will ask!!

Javier Amor Garcia

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1225
  • Karma: +12/-0
    • View Profile
Re: How to change error page
« Reply #8 on: March 19, 2010, 02:35:27 pm »
Yes, those files are unmanaged by eBox so you could do whatever you wanth with them

HANNES1985

  • Zen Warrior
  • ***
  • Posts: 141
  • Karma: +0/-0
    • View Profile
    • CSIWISP
Re: How to change error page
« Reply #9 on: March 19, 2010, 02:44:08 pm »
Thank you very much
Javier Amor Garcia
Only people that wants to no more will ask!!

HANNES1985

  • Zen Warrior
  • ***
  • Posts: 141
  • Karma: +0/-0
    • View Profile
    • CSIWISP
Re: How to change error page
« Reply #10 on: March 21, 2010, 12:45:27 am »
Okay that's done Ive set all the error pages that my squid handles

Only question I have Is where did they hide the 404 error page I cant find it using
Quote
See http://contentfilter.futuragts.com/wiki/doku.php?id=template_customization
or browsing the directories with winCSP

Can anyone help me on this one?
Only people that wants to no more will ask!!

Sam Graf

  • Guest
Re: How to change error page
« Reply #11 on: March 21, 2010, 10:50:46 pm »
I think generally people create custom error pages and then tell Apache where they are. There are a variety of custom error page tutorials out there, but here are some with a little variety, from a Google search, to give you something to think about:

http://www.yourhtmlsource.com/sitemanagement/custom404error.html
http://www.webreference.com/programming/apache_errors/
http://www.devshed.com/c/a/Apache/Custom-Error-Pages-with-Apache/

HANNES1985

  • Zen Warrior
  • ***
  • Posts: 141
  • Karma: +0/-0
    • View Profile
    • CSIWISP
Re: How to change error page
« Reply #12 on: March 21, 2010, 11:12:57 pm »
Quote
I think generally people create custom error pages and then tell Apache where they are. There are a variety of custom error page tutorials out there, but here are some with a little variety, from a Google search, to give you something to think about:

Thank you but how do we tell Apache where to look for this page?
Only people that wants to no more will ask!!

Sam Graf

  • Guest
Re: How to change error page
« Reply #13 on: March 22, 2010, 12:26:58 am »
That is in the tutorials. The two ways the demonstrated in the links I posted are editing Apache's .conf file and using .htaccess (which, I think, is the method often used by tools like cPanel in shared hosting environments).

HANNES1985

  • Zen Warrior
  • ***
  • Posts: 141
  • Karma: +0/-0
    • View Profile
    • CSIWISP
Re: How to change error page
« Reply #14 on: March 22, 2010, 12:33:22 am »
Thanks Sam

Ill have a look into it !
Only people that wants to no more will ask!!