You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Oteng Michael Raesima <mi...@gmail.com> on 2008/03/10 15:53:07 UTC

[users@httpd] SSI help

Good day to you all

Im am newbie to Apache but will try and explain my problem as much as i can.
I have a localhost Apache installation.
I am trying to implement custom error messages returned to the client.
Example, I would like to display my own 403
forbidden error message when a user tries to access restricted
content. In this message i would like to display the client's
IP address and maybe time of access.

I tried to follow the SSI document in Apache website but i still cannot get
the values for these parameters. Could anyone please
help.


Thank you and best regards


OMR

Re: [users@httpd] SSI help

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, Mar 10, 2008 at 12:55 PM, Oteng Michael Raesima
<mi...@gmail.com> wrote:
> Hi
>
> thanx a lot for your response. I have made the following modification to the
> apache2.conf file so that i can use SSI using the ErrorDocument:

> > Show us what you've done so far. Remember that the variables need to
> > have REDIRECT_ prepended:
> > http://httpd.apache.org/docs/2.2/custom-error.html

What about my second sentence?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] SSI help

Posted by Oteng Michael Raesima <mi...@gmail.com>.
Hi

thanx a lot for your response. I have made the following modification to the
apache2.conf file so that i can use SSI using the ErrorDocument:

   Alias /error/ "/usr/share/apache2/error/"

   <Directory "/usr/share/apache2/error">
        AllowOverride None
        Options MultiViews +IncludesNoExec FollowSymLinks
    AddType text/html .shtml
    <FilesMatch "\.shtml[.$]">
        SetOutputFilter INCLUDES
    </FilesMatch>
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en cs de es fr it nl sv pt-br ro
        ForceLanguagePriority Prefer Fallback
    </Directory>

    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
    ErrorDocument 403 /error/HTTP_FORBIDDEN.shtml

In the /HTTP_FORBIDDEN.shtml file i have something like

<HTML>

<HEAD>

<TITLE>403 Forbidden</TITLE>

</HEAD>

<BODY>

<H1>Forbidden</H1>

<HR>

You do not have permission to perform the requested action.

There is either potential harm or the directory is read-protected.

<P>



Your IP address is <!--#echo var="REMOTE_ADDR" --><br>

<HR>

</BODY>

</HTML>

This is just for educational purposes and i am experimenting.

Thank you

OM Raesima

On Mon, Mar 10, 2008 at 2:59 PM, Joshua Slive <jo...@slive.ca> wrote:

> On Mon, Mar 10, 2008 at 10:53 AM, Oteng Michael Raesima
> <mi...@gmail.com> wrote:
> > Good day to you all
> >
> > Im am newbie to Apache but will try and explain my problem as much as i
> can.
> > I have a localhost Apache installation. I am trying to implement custom
> > error messages returned to the client. Example, I would like to display
> my
> > own 403
> >  forbidden error message when a user tries to access restricted content.
> In
> > this message i would like to display the client's
> >  IP address and maybe time of access.
> >
> > I tried to follow the SSI document in Apache website but i still cannot
> get
> > the values for these parameters. Could anyone please
> >  help.
>
> Show us what you've done so far. Remember that the variables need to
> have REDIRECT_ prepended:
> http://httpd.apache.org/docs/2.2/custom-error.html
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] SSI help

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, Mar 10, 2008 at 10:53 AM, Oteng Michael Raesima
<mi...@gmail.com> wrote:
> Good day to you all
>
> Im am newbie to Apache but will try and explain my problem as much as i can.
> I have a localhost Apache installation. I am trying to implement custom
> error messages returned to the client. Example, I would like to display my
> own 403
>  forbidden error message when a user tries to access restricted content. In
> this message i would like to display the client's
>  IP address and maybe time of access.
>
> I tried to follow the SSI document in Apache website but i still cannot get
> the values for these parameters. Could anyone please
>  help.

Show us what you've done so far. Remember that the variables need to
have REDIRECT_ prepended:
http://httpd.apache.org/docs/2.2/custom-error.html

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org