Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Disable Access Logs
PostPosted: Tue Apr 06, 2010 8:33 pm 
Offline
Junior Member

Joined: Sun Oct 11, 2009 12:44 pm
Posts: 29
Location: Northern Ireland
This question is probably quite trivial, but I'd love it if someone could let me know if I'm doing this right!

I want to fully disable the access logs for all of my sites. When I set up the virtual hosts, I specified where to write the access logs.

If I just delete that line, will that stop the server from trying to write the log at all? Or will it still try to, but just end up writing nothing?


(I'll still keep storing error logs, but the access ones seem like a waste of CPU and they've built up to massive file sizes which is a nuisance)

Thanks for taking the time to read!


Top
   
 Post subject:
PostPosted: Tue Apr 06, 2010 8:51 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
Michael-Martin wrote:
I want to fully disable the access logs for all of my sites. When I set up the virtual hosts, I specified where to write the access logs.


Presumably you're talking about a web server -- but which one ? For nginx at least, you can use the directive
Code:
access_log      off;


Don't forget that you can also rotate, compress and delete the logs using something like logrotate(8).


Top
   
 Post subject:
PostPosted: Tue Apr 06, 2010 11:14 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
If you're using Apache, you have to comment out both (1) the access log setting in the main configuration file (apache2.conf or httpd.conf), and (2) the access log setting for each virtual host. After that, Apache will not even try to write any access logs.

But why would you want to do that? Want bad guys to be able to mess with your sites without leaving any trace?


Top
   
 Post subject:
PostPosted: Wed Apr 07, 2010 5:29 am 
Offline
Junior Member

Joined: Sun Oct 11, 2009 12:44 pm
Posts: 29
Location: Northern Ireland
Thanks for the replies mjrich and hybinet, sounds perfect! Sorry, I forgot to say the server (It's Apache).



@hybinet - The reason is just that I've never done anything with the access logs. They're about 6GB in size at the minute, and because of that, if something did happen to the site, I'm not sure I'd ever even be able to find suspicious activity in all those thousands of entries :(

Or should I be watching the logs a little more closely?


Top
   
 Post subject:
PostPosted: Wed Apr 07, 2010 7:52 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
You probably want to look into the "logrotate" program.

Code:
-rw-r--r--  1 www-data www-data  15202284 2010-03-21 05:09 access.log.3.gz
-rw-r--r--  1 www-data www-data  14730444 2010-03-28 04:44 access.log.2.gz
-rw-r--r--  1 www-data www-data  14034340 2010-04-04 04:55 access.log.1.gz
-rw-r--r--  1 www-data www-data 107838104 2010-04-07 07:47 access.log


Uncompressed, this site produces about 250MB of logs per week, which compress to under 15MB. Easier than turning off logging.


Top
   
 Post subject:
PostPosted: Wed Apr 07, 2010 4:37 pm 
Offline
Junior Member

Joined: Sun Oct 11, 2009 12:44 pm
Posts: 29
Location: Northern Ireland
Thanks for that hoopycat! Setting it up now :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group