logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Unknown apache2.4 access log
Author
andihdr



Joined: 03 Feb 2016
Posts: 8
Location: indonesia

PostPosted: Wed 03 Feb '16 11:29    Post subject: Unknown apache2.4 access log Reply with quote

I have installed apache server and i found my access log is not showing something normal. I have search for this error in google and this forum but there are no detail solution on how to fix this problem.

Here is some unknown log :

Code:

"GET http://www.google.com/?nord=1#nord=1&q=blogesaurus HTTP/1.1" 200 146

"GET http://zc.qq.com/cgi-bin/common/attr?id=260714&r=0.0235660493602285 HTTP/1.1" 404 217

"CONNECT l.yimg.com:80 HTTP/1.1" 200 146

"GET http://www.carljzhou.com/azenv.php HTTP/1.1" 404 207



There are many logs like this in my access log.
How to avoid this ? Should I concern/ignore this ? What should i do ?
Many thanks for the help
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Wed 03 Feb '16 19:49    Post subject: Reply with quote

Those messages in your access logs are showing that someone somewhere is poking and prodding your Apache Server looking for clues as to what you have and how they might be able to exploit any vulnerabilities.

As to what to do, make sure that you have "hardened and secured" your Apache Server.

What you can do also, is report these hacking/exploit attempts to ABUSE for the domain and/or ISP they are originating from.

-S
Back to top
andihdr



Joined: 03 Feb 2016
Posts: 8
Location: indonesia

PostPosted: Tue 16 Feb '16 13:41    Post subject: Reply with quote

i have followed this link
http://wiki.apache.org/httpd/FAQ#Why_can_I_access_my_website_from_the_server_or_from_my_local_network.2C_but_I_can.27t_access_it_from_elsewhere_on_the_Internet.3F

but still the logs keep coming up in my access log...
i have search a lot of websites but i can`t get the correct answer.

i have modified httpd.conf to secure apache
http://www.petefreitag.com/item/505.cfm
but still doesn`t work at all.


Is there any suggestions please?
Does this kind of logs appear in every apache`s access log ?
How to avoid these logs?

thanks for reply.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Tue 16 Feb '16 18:09    Post subject: Reply with quote

You want to see that information in your logs. It is informational, letting you know what is going on with your WEB server.

The 404 error is letting you know that the connection attempt was unsuccessful/was not granted.

If you want to stop it completely, you can trace the IP address where the so called connection attempt originated and block it upstream (i.e. at your firewall).

I get log entries like that all the time in my access logs and use configurations in my htttpd.conf to stop them.

Look at it this way, its basically good guys (US) versus the bad guys (THEM). It is a battle that will never end. Just do your best and exercise caution to deter them the best you can.
Back to top
andihdr



Joined: 03 Feb 2016
Posts: 8
Location: indonesia

PostPosted: Wed 17 Feb '16 2:18    Post subject: Reply with quote

thank you DnvrSysEngr for reply.

what kind of configuration in httpd.conf (directives) should i add to stop these logs?

should i use htaccess for this purpose?
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 226
Location: Denver, CO USA

PostPosted: Wed 17 Feb '16 3:09    Post subject: Reply with quote

I used Mod_ip2location (not sure if Gregg of Steffen has a 32 or 64 bit version readily available) to create a blocklist by country. I placed the entries in my httpd.conf file.

However, you may want to be careful as to how you use it if you are hosting more than one site on your Web server.

You can also use mod_maxmind, which is available at https://www.apachehaus.net/temp/
Back to top
andihdr



Joined: 03 Feb 2016
Posts: 8
Location: indonesia

PostPosted: Wed 17 Feb '16 5:41    Post subject: Reply with quote

unfortunately, Mod_ip2location is not free...
thank you DnvrSysEngr.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 17 Feb '16 9:48    Post subject: Reply with quote

I think mod_maxminddb is the way to go if you have a VC14 Apache 2.4.

I do have mod_ip2location v7.0.0 for VC11 Apache 2.4 and I just put those for now also in
https://www.apachehaus.net/temp/

Both Maxmind and IP2Location have free "Lite" databases and they work good enough for blocking by country.

http://dev.maxmind.com/geoip/geoip2/geolite2/
http://lite.ip2location.com/
Back to top
andihdr



Joined: 03 Feb 2016
Posts: 8
Location: indonesia

PostPosted: Wed 17 Feb '16 16:20    Post subject: Reply with quote

Thank you glsmith, i will try mod_iplocation lite because i use VC11 Apache 2.4.

Is mod_security able to solve this issue?
Anyone has suggestion about this? I think it's quite frustrating to only avoid these access logs...or should i ignore them? From what i have read, status code of 200,404 and 400 with 200 of size is not a "thread to my server" right??
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Wed 17 Feb '16 20:13    Post subject: Reply with quote

No, mod_security might turn those 200s in your first post into 400s or 403s however.

200 means it was served, I personally like to know what has been viewed and downloaded. For instance I can see that someone from Indonesia looked on my server, came from this forum thread and was using Google Chrome on 32bit Win7. The connection was over the HTTP/2 protocol.

404 is File Not Found, I like to know this as well because there may something I think should be available but through some mistake of mine it is not.

400, 403 & 500 end up in error.log as well so I do not care if they are in the access.log, I do not block them however.

The only thing I block from my access.log is my own hits to my server. When building a site or script I hit it 100s of times to view/debug as I go, I do not need all my hits polluting up the access.log file.

<soapbox>
It's good to keep an eye on your logs. I rotate my access.log daily (mod_log_rotate) and I know what is the usual size of these files an I know that weekend traffic is typically 1/5 to 1/4 of weekdays. If all of a sudden I see a day that is more than 3 times the average size, I know something is going on and I can investigate.
</soapbox>

The question however is how to keep certain requests from being logged. It's pretty easy using SetEnvIf and CustomLog.

See the "Conditional Logs" section at
http://httpd.apache.org/docs/2.4/logs.html#accesslog

I'm pretty sure you can use any of the available environment variables (like HTTP_STATUS).
Back to top
andihdr



Joined: 03 Feb 2016
Posts: 8
Location: indonesia

PostPosted: Sat 20 Feb '16 11:58    Post subject: Reply with quote

I will try with setenvif and custom log. I hope this might solve my problems.

Thanks...
Back to top
andihdr



Joined: 03 Feb 2016
Posts: 8
Location: indonesia

PostPosted: Sat 20 Feb '16 12:21    Post subject: Reply with quote

glsmith , i have read your previous post

Code:

RewriteEngine on

# [Multi-Useragent]
..
..
..
# [HTTP_USER_AGENT]
# ::ELNSB50 EmailHarvesting & GuestbookSpamming
..
..
# Send them home to mama or a dead connection
RewriteRule


i write them in my httpd.conf and it gives me error "invalid command 'RewriteEngine' , perhaps misspelled or defined by a module not included in the server configuration"
Do you use .htaccess?
Back to top
andihdr



Joined: 03 Feb 2016
Posts: 8
Location: indonesia

PostPosted: Sat 20 Feb '16 13:20    Post subject: Reply with quote

how to RewriteCond for this?

Code:

"GET http://www.google.com/?nord=1#nord=1&q=blogesaurus HTTP/1.1" 200 146

"GET http://zc.qq.com/cgi-bin/common/attr?id=260714&r=0.0235660493602285 HTTP/1.1" 404 217

"CONNECT l.yimg.com:80 HTTP/1.1" 200 146

"GET http://www.carljzhou.com/azenv.php HTTP/1.1" 404 207

Back to top


Reply to topic   Topic: Unknown apache2.4 access log View previous topic :: View next topic
Post new topic   Forum Index -> Apache