LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to customize 403 error page in apache on Linux? (https://www.linuxquestions.org/questions/linux-software-2/how-to-customize-403-error-page-in-apache-on-linux-839705/)

Hariharan 10-22-2010 01:50 AM

How to customize 403 error page in apache on Linux?
 
Hi All,
I've configured in apache on linux to display custome error page for error 403.
i just entered the following line in httpd.conf file
ErrorDocument 403 /path/for/html/file

Here we are using Https.
Any idea how to configure it so that the custom error page is displayed my .html file?


Thanks,
Hariharan V.

bathory 10-22-2010 02:15 AM

Hi,

Could you tell what's wrong with that?
It should work and display the /path/for/html/file when a 403 error occurs

Hariharan 10-22-2010 06:34 AM

Hi,

It shows default page only

bathory 10-22-2010 06:59 AM

You mean the message:
Quote:

Forbidden

You don't have permission to access /blah on this server.
produced by apache?
Are you sure that /path/for/html is under the DocumentRoot? Mind that you don't use a full path from "/", but a path relative to DocumentRoot. So if DocumentRoot is /var/www, the file location on the filesystem should be at /var/www/path/for/html/file

Hariharan 10-22-2010 07:38 AM

Hi,

This is what am got

ForbiddenYou don't have permission to access /login/visitor/loginMG.jsp on this server.Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


Apache/2.2.3 (Red Hat) Server at basic35.lifeisu.com Port 443

bathory 10-22-2010 08:00 AM

Hi,

This is a permissions problem. You can run:
Code:

chmod 755 /login
chmod 755 /login/visitor

and see if it works

Also it could be a SELinux problem if you're trying to access a directory outside the DocumentRoot (that's /var/www/html by default for RHEL)

Hariharan 10-22-2010 10:16 AM

Hi
Thank u....
where i ve to execute that command and for what file?

bathory 10-22-2010 12:11 PM

Hi,

Open a xterm, become root if neede by running su or sudo and run those chmod commands.

Cheers


All times are GMT -5. The time now is 01:12 AM.