Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Apache & Error log

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Showing dot files in directory listing  
Author Message
jeremy4

External


Since: Sep 06, 2004
Posts: 3



(Msg. 1) Posted: Mon Sep 06, 2004 1:25 pm
Post subject: Apache & Error log
Archived from groups: alt>apache>configuration (more info?)

Hi,

I am wondering how to get the referer of a page that contains an error.

I explain with an example.

Suppose I have a page a.php that contains an img src="b.jpg". If the image
is missing, I will get in the error log sth like :

[Mon Sep 6 02:05:33 2004] [error] [client 80.8.88.85] File does not exist:
/opt/web/domains/com/m/mysite.com/www.mysite.com/public_html/b.jpg


But how can I know the error was on a.php ? I need to get the referer of the
error... But this cannot be put in the log !
Same question for "classic" missing pages 404 errors.

Thanx for help.

--
Jeremy

 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Mon Sep 06, 2004 1:25 pm
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-09-06, Jérémy <jeremy@[> wrote:
 > [Mon Sep 6 02:05:33 2004] [error] [client 80.8.88.85] File does not exist:
 > /opt/web/domains/com/m/mysite.com/www.mysite.com/public_html/b.jpg
 > But how can I know the error was on a.php ?

I bet that if you look at the access_log file you'll see that
Mon Sep 6 02:05:33 2004 a page called a.php has been called. So if
you cross-reference the two you'll get which page was.
Otherwise, there are many automatic programs that can query your
web site and locate this kind of errors.

Davide

--
ROMEO: Courage, man; the hurt cannot be much.
MERCUTIO: No, 'tis not so deep as a well, nor so wide as a church-
  door; but 'tis enough, 'twill serve.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
jeremy4

External


Since: Sep 06, 2004
Posts: 3



(Msg. 3) Posted: Mon Sep 06, 2004 4:43 pm
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Davide Bianchi" <davideyeahsure.TakeThisOut@onlyforfun.net> a écrit dans le message de
news: slrncjo8mc.1v1.davideyeahsure.TakeThisOut@fogg.onlyforfun.net...
 > On 2004-09-06, Jérémy <jeremy@[> wrote:
  >> [Mon Sep 6 02:05:33 2004] [error] [client 80.8.88.85] File does not
  >> exist:
  >> /opt/web/domains/com/m/mysite.com/www.mysite.com/public_html/b.jpg
  >> But how can I know the error was on a.php ?
 >
 > I bet that if you look at the access_log file you'll see that
 > Mon Sep 6 02:05:33 2004 a page called a.php has been called. So if
 > you cross-reference the two you'll get which page was.
 > Otherwise, there are many automatic programs that can query your
 > web site and locate this kind of errors.
 >
 > Davide
 >
Well,
could you give me the name of one of these programs ? All the stuff I found
don't do exactly what I want.

thx


--
--
Jérémy S.
Développeur
<a style='text-decoration: underline;' href="http://www.leguide.com/" target="_blank">http://www.leguide.com/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 4) Posted: Mon Sep 06, 2004 4:43 pm
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-09-06, Jérémy <jeremy@[> wrote:
 > could you give me the name of one of these programs?

<a style='text-decoration: underline;' href="http://www.google.com/search?q=html+check+links" target="_blank">http://www.google.com/search?q=html+check+links</a>
Davide

--
We wish you a Hare Krishna
We wish you a Hare Krishna
We wish you a Hare Krishna
And a Sun Myung Moon!
   -- Maxwell Smart<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
kalvaronospamt

External


Since: Feb 25, 2004
Posts: 58



(Msg. 5) Posted: Mon Sep 06, 2004 11:24 pm
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

*** Jérémy escribió/wrote (Mon, 6 Sep 2004 10:25:02 +0200):
 > I am wondering how to get the referer of a page that contains an error.

If I understood what you say, your web server logs do not keep the
HTTP_REFERER variable but you want to use it to take care of broken links.
You have two options:

* Change logging format. In Apache you can use the 'combined' format.

* Create a custom error page that is a PHP script (or whatever server-side
scripting lang you know). That script can perform any action you need when
HTTP_REFERER is not empty (mail you or log it to a file). In Apache you can
do it with the ErrorDocument directive.


--
-+ Álvaro G. Vicario - Burgos, Spain
+- <a style='text-decoration: underline;' href="http://www.demogracia.com" target="_blank">http://www.demogracia.com</a> (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
dinges_danges_

External


Since: Aug 03, 2004
Posts: 88



(Msg. 6) Posted: Tue Sep 07, 2004 5:07 am
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alvaro G. Vicario said the following on 06/09/2004 20:24:

 > *** Jérémy escribió/wrote (Mon, 6 Sep 2004 10:25:02 +0200):
 >
  >>I am wondering how to get the referer of a page that contains an error.
 >
 > * Change logging format. In Apache you can use the 'combined' format.

That, or a seperate referer logfile. For more details, see:

<a style='text-decoration: underline;' href="http://httpd.apache.org/docs/mod/mod_log_referer.html" target="_blank">http://httpd.apache.org/docs/mod/mod_log_referer.html</a>

--
Regards
Harrie<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
jeremy4

External


Since: Sep 06, 2004
Posts: 3



(Msg. 7) Posted: Mon Sep 13, 2004 11:59 am
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Alvaro G. Vicario" <kAlvaroNOSPAMTHANKS RemoveThis @terra.es> a écrit dans le message
de news: 17f1r1ia3fu1p.m8s7yh7cllak$.dlg@40tude.net...
 > *** Jérémy escribió/wrote (Mon, 6 Sep 2004 10:25:02 +0200):
  >> I am wondering how to get the referer of a page that contains an error.
 >
 > If I understood what you say, your web server logs do not keep the
 > HTTP_REFERER variable but you want to use it to take care of broken links.
 > You have two options:
 >
 > * Change logging format. In Apache you can use the 'combined' format.

I would like to, but the Apache is not able to log the HTTP_REFERER in its
errors log..

 > * Create a custom error page that is a PHP script (or whatever server-side
 > scripting lang you know). That script can perform any action you need when
 > HTTP_REFERER is not empty (mail you or log it to a file). In Apache you
 > can
 > do it with the ErrorDocument directive.
 >
I thought of this, this would work for broken links, but not for missing
images... Wink<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
kalvaronospamt

External


Since: Feb 25, 2004
Posts: 58



(Msg. 8) Posted: Mon Sep 13, 2004 5:59 pm
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

*** Jérémy escribió/wrote (Mon, 13 Sep 2004 08:59:23 +0200):
 > I would like to, but the Apache is not able to log the HTTP_REFERER in its
 > errors log..

Curiously, mine does...

 > I thought of this, this would work for broken links, but not for missing
 > images... Wink

Apache doesn't have the faintest idea of what contents it's serving. For
hime, an image is exactly the same as an HTML document: he's asked for a
URL, he looks for the file, he delivers it if found or returns a 404 Not
Found error code if not found. Period.


--
-+ Álvaro G. Vicario - Burgos, Spain
+- <a style='text-decoration: underline;' href="http://www.demogracia.com" target="_blank">http://www.demogracia.com</a> (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
dinges_danges_

External


Since: Aug 03, 2004
Posts: 88



(Msg. 9) Posted: Mon Sep 13, 2004 8:28 pm
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jérémy said the following on 13/09/2004 08:59:

 > "Alvaro G. Vicario" <kAlvaroNOSPAMTHANKS.TakeThisOut@terra.es> a écrit dans le message
 > de news: 17f1r1ia3fu1p.m8s7yh7cllak$.dlg@40tude.net...
 >
  >>*** Jérémy escribió/wrote (Mon, 6 Sep 2004 10:25:02 +0200):
  >>
   >>>I am wondering how to get the referer of a page that contains an error.
  >>
  >>If I understood what you say, your web server logs do not keep the
  >>HTTP_REFERER variable but you want to use it to take care of broken links.
  >>You have two options:
  >>
  >>* Change logging format. In Apache you can use the 'combined' format.
 >
 > I would like to, but the Apache is not able to log the HTTP_REFERER in its
 > errors log..

Huh? I posted an URL to Apache's mod_log_referer, did you miss it?

Here's it again:

<a style='text-decoration: underline;' href="http://httpd.apache.org/docs/mod/mod_log_referer.html" target="_blank">http://httpd.apache.org/docs/mod/mod_log_referer.html</a>

--
Regards
Harrie<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 10) Posted: Tue Sep 14, 2004 3:03 am
Post subject: Re: Apache & Error log [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Jérémy" <jeremy@[NOSPAM]leguide.com> schreef in bericht
news:4145455e$0$30093$626a14ce@news.free.fr...
 > "Alvaro G. Vicario" <kAlvaroNOSPAMTHANKS.TakeThisOut@terra.es> a écrit dans le message
 > de news: 17f1r1ia3fu1p.m8s7yh7cllak$.dlg@40tude.net...
  > > *** Jérémy escribió/wrote (Mon, 6 Sep 2004 10:25:02 +0200):
   > >> I am wondering how to get the referer of a page that contains an error.
  > > If I understood what you say, your web server logs do not keep the
  > > HTTP_REFERER variable but you want to use it to take care of broken
links.
  > > You have two options:
  > > * Change logging format. In Apache you can use the 'combined' format.
 > I would like to, but the Apache is not able to log the HTTP_REFERER in its
 > errors log..
Indeed formatting the errer_log has not yet been seen.
However, the access_log normally holds a field with the HTTP response code:
check for lines with 400

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Apache & Error log 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
error in apache ?? - hello my english is very poor i have a big problem &lt;?php $handle = sybase_connect("192.168.1.15:2638", "dba", "ant") or die("error !"); sybase_close($handle); ?&gt; When i want connec...

Apache 2.0.49 error - Hello together! I have a very interesting problem on my webserver, a Suse Linux 9.1 with Apache 2.0.49: After running a few hours the memory usage of the httpd2-prefork slows down the whole system, not only web-sites. when I put a ps aux | grep apache I...

Apache error - I am using Solaris8, Weblogic 7sp2 and IBM HTTPD server. Getting the following error [error] READ_TIMEOUT [os error=0, line 199 of ../nsapi/Reader.cpp]: Any help is appreciated. Thanks

Apache start without error - Hi, is possible to start the apache-server so that a missing directory in DocumentRoot is ignored?

error installing apache-ssl - Hello, I try to install on Debian Sarge apache-ssl, but I got this result:: Generating a 1024 bit RSA private key ......++++++ ..................++++++ writing new private key to '/etc/apache-ssl/apache.pem' ----- problems making Certificate Request..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]