Apache access log : multiple status code - apache

In Apache access.log, I am used to this kind of access log line:
127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
I was checking some apache access logs this morning and found something I'm not used to:
192.168.1.10- - [20/Feb/2013:00:00:45 +0000] "POST /form/... 404 200 252 "-" "-" 435835
There are multiple status code. Does-it mean the request was sended multiple times (something like a failed/retry mechanism?

Related

Unknown behavior in Apache HTTPD

Yesterday we faced a strange behavior when reading access log of Apache httpd. An example of below:
207.46.13.135 - - [25/Sep/2022:15:28:28 +0700] "GET / HTTP/1.1" 302 287 (core.c/0/translate_name) - 140
This is a normal access entry: x.x.x.x - - [26/Sep/2022:14:16:57 +0700] "GET /corp/L003/consumer/theme/vn.ssc.css HTTP/1.1" 200 1043 (core.c/0/handler) - 830
We have directives to proxy and redirect the request going to the system. But why this does not redirect (the return code 302 is understandable when in debug mod but why we don't get it when having in production log) – > We suspected that these IPs used some kind of engines to flood the web server, only to response status but not the content.

HTTP-Pipeline gone mad with mobile Safari?

We have a (dynamic) WebApplication and are trying to solve some perfomance issues: When look at our our Apache-Logs it seems that a specific user agent (Safari) is sending multiple IDENTICAL requests during 1 second.
It may have to do with the implemtation of Pipelining in the mobile Version of Safari.
The log entries look like the following lines:
188.102.30.71 - - [16/Jan/2017:21:20:41 +0100] "GET /an/existing/path?a=b >HTTP/1.1" 200 407380 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS >X) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0 Mobile/14C92 >Safari/602.1" /0 /487136
188.102.30.71 - - [16/Jan/2017:21:20:42 +0100] "GET / HTTP/1.1" 200 12876 "-" >"MobileSafari/602.1 CFNetwork/808.2.16 Darwin/16.3.0" /0 /79180
188.102.30.71 - - [16/Jan/2017:21:20:42 +0100] "GET / HTTP/1.1" 200 12876 "-" >"MobileSafari/602.1 CFNetwork/808.2.16 Darwin/16.3.0" /0 /31172
188.102.30.71 - - [16/Jan/2017:21:20:42 +0100] "GET / HTTP/1.1" 200 12876 "-" >"MobileSafari/602.1 CFNetwork/808.2.16 Darwin/16.3.0" /0 /25425
"and more of them..."
It seems that for 1 real user action we receive the identical request for another resource (here the /) several times (8 - 10 times).
Is this the Apple-Implementation of Pipelining? We don't see other User Agents with this behaviour.
Is there a way to prevent these requests? We use Apache for delivering our content.
I am glad for any hints and suggestions which may help to solve this problem.
Tino

Apache Access Logs: Can we configure what NOT to log?

My Apache (Linux/CentOS) is behind a load balancer (AWS ELB). So in my Apache access_log, there are tons of useless logs, like:
- - - [13/Jan/2016:23:38:02 +0800] "GET / HTTP/1.1" 200 16 "-" "ELB-HealthChecker/1.0"
- - - [13/Jan/2016:23:42:39 +0800] "OPTIONS * HTTP/1.0" 200 - "-" "Apache (internal dummy connection)"
These two logs heavily flooded in my access_log. Actually these two are totally useless for me (since they are just internal health checkers only), but affecting/confusing to my log analyzers, like awstats. So i kinda don't want to have this kind of log entries.
Is there a way to configure Apache to WHAT NOT TO log?

Customizing Apache Logs

I am running a website with siginup/login process. and I like to insert user ids when the user signs up or in to my website.
My apache access.log is as in the following:
115.137.10.87 - - [26/Aug/2013:07:38:52 +0900] "GET /api/game/ HTTP/1.1" 200 1402 "-" "android-async-http/1.4.3 (http://loopj.com/android-async-http)"
115.137.10.87 - - [26/Aug/2013:07:38:59 +0900] "GET /api/premium/brand HTTP/1.1" 200 721 "-" "android-async-http/1.4.3 (http://loopj.com/android-async-http)"
115.137.10.87 - - [26/Aug/2013:07:38:59 +0900] "GET /api/brand/ HTTP/1.1" 200 2510 "-" "android-async-http/1.4.3 (http://loopj.com/android-async-http)"
115.137.10.87 - - [26/Aug/2013:07:39:00 +0900] "GET /api/game/ HTTP/1.1" 200 1402 "-" "android-async-http/1.4.3 (http://loopj.com/android-async-http)"
I can clearly see what http request was sent from what ip address.
But if I put the user id (eg. $userid) to this log, it would be wonderful log, and I will be able to get a good statistic information for making decision.
If it is possible, is there any way to do this?
Any advice will be really appreciated.
The log will be like this:
115.137.10.87 - - [26/Aug/2013:07:38:52 +0900] "***[USERID]*** GET /api/game/ HTTP/1.1" 200 1402 "-" "android-async-http/1.4.3 (http://loopj.com/android-async-http)"
If you are using HTTP Basic or Digest authentication, then the user name is derived from an HTTP header and can be inserted into the log by using %u in a LogFormat directive in your apache config. If you have a login system that does not include the username in a header (likely), then the only other option I know of would be to somehow set an environment variable which Apache could then write out with %{FOOBAR}e. See http://httpd.apache.org/docs/2.2/logs.html
Otherwise, you're probably better off writing out your own log file from your application code (or use an application level logging library - Log4j, or whatever.)

Apache 500 Error due to User Agent?

I am currently getting 500 errors from Apache using a alarming probe shell script that has been provided to myself.
Unfortunately I have not been able to get to the bottom of why the script generates a 500 error when attempting to access content locally on the server but using other methods like wget and telnet works fine.
The following are the Apache access log entries for each of the attempts:
Using Wget
127.0.0.1 - "" [19/Mar/2013:14:31:44 +1100] "GET /index.html HTTP/1.1" 200 1635 "-" "Wget/1.13.3" "-"
Using Telnet
127.0.0.1 - "" [20/Mar/2013:13:12:11 +1100] "GET /index.html HTTP/1.1" 200 1635 "-" "-" "-"
Using the Probe Scripts
127.0.0.1 - - [19/Mar/2013:14:33:56 +1100] "GET /index.html HTTP/1.1" 500 - "-" "" "-"
The only difference I can see is that the probe has a - instead of a "" in the user agent (3rd item) which either way tells me it wasn't passed in any of the instances (as this is expected since there is no authentication).
I've bumped up the logging for everything in Apache and can't figure out what is amiss. There is no processing involved, it's a static file, and I have attempted with other file types too, like images to no avail.
Does anyone have any ideas or has seen something similar?
Thanks,
Tony