LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 06-23-2006, 09:56 AM   #1
mac_casey
Member
 
Registered: Jun 2002
Location: Edmonton
Distribution: SUSE 10
Posts: 62

Rep: Reputation: 15
Apache Custom Errors


Greetings,

I cant for the life of me figure this out. I see that in my SuSE 10 there is a error.conf. My first question is i placed a line for a custom error

ErrorDocument 401 www.somedomain.com/authfail.php

I then get an error that it cant find the document. Should it be a path to /srv/www/htdocs/somedomain/authfail.php?

Additionally how/where do i place a custom error if im hosting multiple namebased virtual hosts? i would what each domain to have their own.

Thanks
 
Old 06-23-2006, 01:53 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
The location of the error document is relative to the document root. For example, in my case I have:
Code:
ErrorDocument 404 /error_404.bot
and my docroot is /var/www/htdocs so I place "error_404.bot" in "/var/www/htdocs/".

In your case I think you want:
Code:
ErrorDocument 401 /somedomain/authfail.php
As for namebased virtual hosts, AFAIK you can just place the "ErrorDocument" directive inside each sites VirtualHost block ie:

Code:
NameVirtualHost *:80
 
<VirtualHost *:80>
 DocumentRoot /www/example1
 ServerName www.example1.com
 ErrorDocument 401 /authfail.php
 # Other directives here
 
</VirtualHost>
 
<VirtualHost *:80>
DocumentRoot /www/example2
ServerName www.example2.org
ErrorDocument 401 /authfail.php
 # Other directives here
 
</VirtualHost>
And for example1.org /www/example1/authfail.php will be served and for example2.org /www/example2/authfail.php will be served.
 
Old 06-23-2006, 02:23 PM   #3
mac_casey
Member
 
Registered: Jun 2002
Location: Edmonton
Distribution: SUSE 10
Posts: 62

Original Poster
Rep: Reputation: 15
Perfect!!

Thanks so much. Makes sence now but didnt last night at 3 am!!

Thanks again.
 
Old 06-23-2006, 02:30 PM   #4
hockeyman_102
Member
 
Registered: Apr 2006
Location: Washington
Distribution: Suse, CentOS, Ubuntu
Posts: 124

Rep: Reputation: 15
i like the locate command.
$ locate authfail.php
might want to run an updatedb first though.
Code:
$ updatedb
$ locate authfail.php
 
Old 06-23-2006, 02:49 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Appreciate the help Hockeyman_102, but that's not the kind of "cant find the document" we are talking about :P
 
  


Reply



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
custom kernel errors, can't figure out... amp_man Linux - General 11 03-05-2005 04:25 AM
custom initrd not working -- INIT errors michael_util Slackware 9 11-24-2004 11:58 AM
Errors compiling custom kernel tron_thomas Linux - General 4 09-03-2004 11:43 AM
Custom Kernel Compilation Errors? d4harvey Red Hat 1 03-16-2004 12:00 PM
Custom errors in mysql agenor Programming 0 03-11-2004 10:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 02:03 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
Open Source Consulting | Domain Registration