Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: HANNES1985 on February 23, 2010, 04:58:19 pm

Title: How to change error page
Post by: HANNES1985 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)
Title: Re: How to change error page
Post by: doperst 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?
Title: Re: How to change error page
Post by: HANNES1985 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

Title: Re: How to change error page
Post by: Sam Graf on March 18, 2010, 08:28:41 pm
See http://contentfilter.futuragts.com/wiki/doku.php?id=template_customization
Title: Re: How to change error page
Post by: HANNES1985 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
Title: Re: How to change error page
Post by: Sam Graf 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.
Title: Re: How to change error page
Post by: Javier Amor Garcia 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
Title: Re: How to change error page
Post by: HANNES1985 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?
Title: Re: How to change error page
Post by: Javier Amor Garcia on March 19, 2010, 02:35:27 pm
Yes, those files are unmanaged by eBox so you could do whatever you wanth with them
Title: Re: How to change error page
Post by: HANNES1985 on March 19, 2010, 02:44:08 pm
Thank you very much
Javier Amor Garcia
Title: Re: How to change error page
Post by: HANNES1985 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?
Title: Re: How to change error page
Post by: Sam Graf 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/
Title: Re: How to change error page
Post by: HANNES1985 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?
Title: Re: How to change error page
Post by: Sam Graf 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).
Title: Re: How to change error page
Post by: HANNES1985 on March 22, 2010, 12:33:22 am
Thanks Sam

Ill have a look into it !
Title: Re: How to change error page
Post by: HANNES1985 on March 23, 2010, 04:09:42 pm
Okay Ive searched and could not find the .HTML page I need to configure or even the directory where I can put my custom page in her is places Ive configured but no luck still getting the same 404 page

/usr/share/apache2/error
/usr/share/squid/errors/English (this changes all pages on the internal going through the squid)
/etc/apache2
/usr/lib/apache2

So If anyone can help me on this one It would be greatly appreciated
Title: Re: How to change error page
Post by: whoiam55 on March 24, 2010, 08:03:37 am
hope this helps

http://www.google.co.in/search?q=custom+apache+error+pages
Title: Re: How to change error page
Post by: Sambukar on April 16, 2010, 09:23:11 pm
http://phpforms.net/tutorial/tutorial.html  (http://phpforms.net/tutorial/tutorial.html)- I consider you find neccessary information here.

Title: Re: How to change error page
Post by: lihnjo on April 18, 2010, 08:27:37 pm
http://forum.ebox-platform.com/index.php?topic=3535.0
Title: Re: How to change error page
Post by: bluekrash on October 19, 2010, 05:10:51 pm
Hi,  for create custom template denied page for dansguardian(squid) u need to go and edit /usr/share/ebox/stubs/squid/template.html.mas