Apache Log Error Referer
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn
Apache Access Log Referer
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users apache referer header Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping apache referer check each other. Join them; it only takes a minute: Sign up Apache 2 error log only shows the error message “0” up vote 2 down vote favorite Since a few days, my Apache 2 error log is showing
Apache Access Log Format
a lot messages like the following (IP addresses and URIs redacted): [Thu Dec 12 13:46:42 2013] [error] [client 111.222.333.444] 0 [Thu Dec 12 13:52:27 2013] [error] [client 222.333.444.555] 0, referer: http://www.mydomain.com/ [Thu Dec 12 13:52:27 2013] [error] [client 222.333.444.555] 0, referer: http://www.mydomain.com/ [Thu Dec 12 13:53:54 2013] [error] [client 333.444.555.666] 0, referer: http://www.mydomain.com/subdirectory/ [Thu Dec 12 13:46:42 2013] [error] [client 444.555.666.777] 0 [Thu Dec 12 13:54:07 2013] [error] [client aaaa:1111:2222:ffff::] 0, referer: http://www.otherdomain.com/subdirectory/ What is this
Apache Access Log Location
0? There are no other messages shown (besides sometimes some other, normal messages, but very rarely). The IP addresses are both IPv4 and IPv6. I checked the access log for the same date/time and IP addresses. Most of the times, there was an access for the exact same moment from this IP for different URIs on my webpage. But sometimes, there wasn't an access according to the access log. It's a shared hosting environment, so I can't access the Apache settings (but I have ssh access to my home directory if this helps). I already googled and searched the Apache documentation, but didn't found anything (it's hard to search for "0"...) /edit: I also asked the webhoster, they said they don't know what it's causing. I cross checked it with the Apache access log, these are requests to PHP scripts (mostly Joomla), but also requests to images as well as JS and CSS files. So I assume it's not a PHP script which is causing this. apache apache2 error-log share|improve this question edited Jan 8 '14 at 16:36 asked Dec 12 '13 at 15:45 Reeno 3,90992237 Are there any .htaccess files that may have the LogFormat directive specified? –klugerama Jan 8 '14 at 17:55 Not from me. Maybe the hoster added something in the httpd.conf but in this case the hoster would know and
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or apache loglevel posting ads with us Unix & Linux Questions Tags Users Badges Unanswered Ask Question _ Unix
Apache Log Rotation
& Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes apache log level a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top How to show 404 error referer in apache logs up vote -1 down vote http://stackoverflow.com/questions/20547862/apache-2-error-log-only-shows-the-error-message-0 favorite I need show the referrer for 404 error in the Apache log file. I found only script in php, it's possible to make through Apache conf? logs apache-httpd share|improve this question edited Oct 3 '14 at 23:33 Gilles 368k666671117 asked Oct 2 '14 at 9:54 hellb0y77 2851824 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote You can have AccessLogs in Combined Format, which will include Referer and status code: LogFormat "%h %l %u %t \"%r\" %>s http://unix.stackexchange.com/questions/158820/how-to-show-404-error-referer-in-apache-logs %b \"%{Referer}i\" \"%{User-agent}i\"" combined CustomLog log/access_log combined in your Apache configuration should do it. share|improve this answer answered Oct 2 '14 at 11:42 Ulrich Schwarz 5,72211435 Ok thanks, i have alredy this conf but some link not write in log, i now have confirmation that is correct. –hellb0y77 Oct 3 '14 at 10:24 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged logs apache-httpd or ask your own question. asked 1 year ago viewed 486 times active 1 year ago Related 3Bot requesting odd resource in apache logs1How to customize apache mod_sec log output?1Piped Logs in Apache?7How do I find where Apache keeps the log files?0Why does apache not define where to log by default?0Whats the best way to clear / empty Apache log files periodically0Excluding internal requests from Apache logs2Find IP owners from apache log file1Apache Log file - Referer URL that doesn't exist0apache 404 error Hot Network Questions Is there any way to make the cut command read the last field only? What is the difference between touch file and > file? Plane determined by two lines Force Microsoft Word to NEVER auto-capitalize the n
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings http://serverfault.com/questions/437388/php-fatal-error-log-referer and policies of this site About Us Learn more about Stack Overflow the https://www.loggly.com/ultimate-guide/apache-logging-basics/ company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody apache log can ask a question Anybody can answer The best answers are voted up and rise to the top PHP Fatal Error log - referer up vote 0 down vote favorite I have the following log entry: [Thu Oct 11 01:02:03 2012] [error] [client 127.0.0.1] PHP Fatal error: Class 'Mage' not found in /var/www/foo/bar/Mage/Core/functions.php on line 244, referer: http://example.com/de/checkout/cart/ Is the referer apache access log shown in this message really the HTTP referer or actually the URL where the error happend? apache-2.2 php magento share|improve this question asked Oct 11 '12 at 16:37 Alex 490622 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Referer = HTTP_REFERER The referer entry in the error log really referes to the page referring to the script (HTTP_REFERER) and not the script where the error actually happend. Verification I just tried it by creating a file foo.html with a hyperlink to a file foo.php The content of `foo.php
Basics Access and Error Logs General Configuration Debian/Ubuntu/Linux Mint Configuration Redhat/Fedora/CentOS Configuration OpenSUSE Configuration Applicable Modules ↑ 0 Apache Logging Basics Log Files An Apache log is a record of the events that have occurred on your Apache web server. Apache stores two kinds of logs: Access Log Contains information about requests coming in to the web server. This information can include what pages people are viewing, the success status of requests, and how long the request took to respond. It looks something like this: Apache 10.185.248.71 - - [09/Jan/2015:19:12:06 +0000] 808840 "GET /inventoryService/inventory/purchaseItem?userId=20253471&itemId=23434300 HTTP/1.1" 500 17 "-" "Apache-HttpClient/4.2.6 (java 1.5)" 1 10.185.248.71 - - [09/Jan/2015:19:12:06 +0000] 808840 "GET /inventoryService/inventory/purchaseItem?userId=20253471&itemId=23434300 HTTP/1.1" 500 17 "-" "Apache-HttpClient/4.2.6 (java 1.5)" Error Log Contains information about errors that the web server encountered when processing requests, such as when files are missing. It looks something like this: [Thu Mar 13 19:04:13 2014] [error] [client 50.0.134.125] File does not exist: /var/www/favicon.ico 1 [Thu Mar 13 19:04:13 2014] [error] [client 50.0.134.125] File does not exist: /var/www/favicon.ico Location Access and error log files are stored on individual web servers. The exact location of your Apache logs depends on your operating system: Debian/Ubuntu/Linux Mint Redhat/Fedora/CentOS Configuration OpenSUSE The following general default logging configuration directives are specified in absence of specific virtual host container configuration. Log Level Directive This specifies log message severity. Default is “warn.” LogLevel warn Table of Level Severities Severity Description Example emerg Emergencies — system is unusable “Child cannot open lock file. Exiting” alert Immediate action required “getpwuid: couldn’t determine user name from uid” crit Critical conditions “socket: Failed to get a socket, exiting child” error Error conditions “Premature end of script headers” warn Warning conditions “child process 1234 did not exit, sending another SIGHUP” notice Normal but significant condition “httpd: caught SIGBUS, attempting to dump core in …” info Informational “Server seems busy…” debug Debug-level messages “opening config file …” trace1-8 Trace messages “proxy: FTP: … ” Note regarding a particular level: Levels are listed in order of descending severity. When triggered, a configured log level will log all events of that level