LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 03-18-2010, 07:56 PM   #1
ppawcio
LQ Newbie
 
Registered: Mar 2010
Posts: 4

Rep: Reputation: 0
How can i replace 503 error page in Apache?


I run Linux RedHat and want to find out how can I replace the standard Apache 503 error page with my own? This is my configuration in the httpd.conf file for error pages. Can I just edit the HTTP_SERVICE_UNAVAILABLE.html.var in /var/www/error directory and replace the content with my own , or how can I accomplish my goal?

Thanks

Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
<Directory "/var/www/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
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 404 /error/HTTP_NOT_FOUND.html.var
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
# ErrorDocument 410 /error/HTTP_GONE.html.var
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var

</IfModule>
</IfModule>
 
Old 03-18-2010, 08:08 PM   #2
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 96
Quote:
Can I just edit the HTTP_SERVICE_UNAVAILABLE.html.var in /var/www/error directory and replace the content with my own
You can. And uncomment "ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var" of course.
 
Old 03-19-2010, 12:05 AM   #3
ppawcio
LQ Newbie
 
Registered: Mar 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by troop View Post
You can. And uncomment "ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var" of course.
Thank you for the help. Will this also work even if Apache is configured as a Proxy?
 
Old 03-20-2010, 11:18 PM   #4
ppawcio
LQ Newbie
 
Registered: Mar 2010
Posts: 4

Original Poster
Rep: Reputation: 0
I tried renaming the orignal error documents but it was not working. So what i actually did was this:

# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 400 /error/include/400.html

I simply added my own 400 html page to the include directory and it worked fine. Thanks all for your help again.
 
  


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
Tomcat 5.5; 503 error; Image processing; Apache 2.2; Fedora Core 5. elprawn Programming 8 06-26-2009 05:58 AM
Apache Error page justkeny2k Linux - Server 1 07-16-2007 04:42 AM
HTTP 503 when connecting to Apache with SSL ddenton Linux - Server 2 05-09-2007 09:28 AM
error page from apache server pankajkarde Linux - Server 2 03-05-2007 02:57 AM
Error 503 Apache v2-ncl Linux - Software 1 07-07-2004 07:36 PM


All times are GMT -5. The time now is 01:15 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration