LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-22-2010, 01:50 AM   #1
Hariharan
Member
 
Registered: Nov 2004
Location: Bangalore
Posts: 64

Rep: Reputation: 0
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.
 
Old 10-22-2010, 02:15 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,196

Rep: Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676
Hi,

Could you tell what's wrong with that?
It should work and display the /path/for/html/file when a 403 error occurs
 
Old 10-22-2010, 06:34 AM   #3
Hariharan
Member
 
Registered: Nov 2004
Location: Bangalore
Posts: 64

Original Poster
Rep: Reputation: 0
Hi,

It shows default page only
 
Old 10-22-2010, 06:59 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,196

Rep: Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676
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
 
Old 10-22-2010, 07:38 AM   #5
Hariharan
Member
 
Registered: Nov 2004
Location: Bangalore
Posts: 64

Original Poster
Rep: Reputation: 0
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
 
Old 10-22-2010, 08:00 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,196

Rep: Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676
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)
 
Old 10-22-2010, 10:16 AM   #7
Hariharan
Member
 
Registered: Nov 2004
Location: Bangalore
Posts: 64

Original Poster
Rep: Reputation: 0
Hi
Thank u....
where i ve to execute that command and for what file?
 
Old 10-22-2010, 12:11 PM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,196

Rep: Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676Reputation: 1676
Hi,

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

Cheers
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Error 403 - CentOS 5.2 with Apache 2.2.3 gordymann Linux - Newbie 2 04-08-2009 08:57 AM
403 error in Apache watcher69b Linux - Server 3 05-27-2008 08:13 AM
SSL & SuSE - Get a 403 error when requesting secure page marigny Linux - Software 2 10-11-2005 05:25 AM
Apache 403 Error?? jlsain Linux - Software 4 05-08-2004 03:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration