LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-04-2015, 01:25 AM   #1
Revenge7
Member
 
Registered: Mar 2015
Posts: 38

Rep: Reputation: Disabled
Unhappy SetEnvIf is not blocking image requests


Hi guys,

I am trying to block the image requests in access_log by adding below lines to httpd.conf. But somehow it is not working and image requests are still shown on logs. (They are too unnecessary and causing the log's size getting increase fastly)

SetEnvIf Request_URI "\.css" dontlog
SetEnvIf Request_URI "\.js" dontlog
SetEnvIf Request_URI "\.gif" dontlog
SetEnvIf Request_URI "\.jpg" dontlog
SetEnvIf Request_URI "\.jpeg" dontlog
SetEnvIf Request_URI "\.png" dontlog

CustomLog /usr/local/apache/logs/access_log common env=!dontlog

Some part of logs after change httpd.conf and restart (stop-start) apache:

./SAP-icons.ttf HTTP/1.1" 200
./SAP-icons.ttf HTTP/1.1" 200
./View.controller.js HTTP/1.1" 200
./SelectionView.view.js HTTP/1.1" 200
./SelectionView.controller.js HTTP/1.1" 200
./View.view.js HTTP/1.1" 200
./View.controller.js HTTP/1.1" 200
./View.view.js HTTP/1.1" 200
./View.controller.js HTTP/1.1" 200
./View.view.js HTTP/1.1" 200
./views/FQConfirmView.controller.js HTTP/1.1" 200
./thirdparty/mobiscroll/js/mobiscroll-core.js HTTP/1.1" 200
./thirdparty/mobiscroll/css/mobiscroll-core.css HTTP/1.1" 200
./thirdparty/mobiscroll/js/mobiscroll-scroller.js HTTP/1.1" 200
./thirdparty/mobiscroll/js/mobiscroll-datetime.js HTTP/1.1" 200

I guess syntax is correct (I tried them either "\.css" or \.css). What would be the reason that it does not work ?

Last edited by Revenge7; 12-04-2015 at 01:43 AM.
 
Old 12-04-2015, 02:58 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

The syntax is correct. See the 3rd example here.
Most likely you're using another CustomLog directive (maybe inside a vhost definition), without the "env=!dontlog" part.
 
Old 12-04-2015, 03:10 AM   #3
Revenge7
Member
 
Registered: Mar 2015
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
Hi,

The syntax is correct. See the 3rd example here.
Most likely you're using another CustomLog directive (maybe inside a vhost definition), without the "env=!dontlog" part.
I solved the problem by deleting another CustomLog couple minutes ago with same thought Thank you anyway.
 
  


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
UFW blocking certain incoming requests and not sure why smells_of_elderberries Linux - Security 10 04-02-2013 06:19 PM
Blocking repeating HTTP/1.0 requests w/ Shorewall stormreactor Linux - Newbie 2 08-19-2011 01:23 AM
Blocking ICMP requests metallica1973 Linux - Security 4 04-02-2006 12:48 PM
Firewall blocking some POP3 requests Funky D Linux - Networking 5 09-23-2005 04:21 PM
blocking DHCP requests jjfate Linux - Networking 4 06-20-2003 01:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:54 AM.

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