• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

Access Log Question

I have a linux server with the following access / error / ssl log files:

access_log
access_log.1
access_log.2
access_log.3
error_log.1
error_log.2
ssl_error_log.1

etc. etc.

I have 2 questions:

#1. can I delete these log files safely without damaging the server (in other words, will it rewrite them if I delete them or hurt the system?

#2 - Can I change what is being logged so they do not get so big? Right now the access_log.3 is at 2 gigs.

Thanks!
0
foreverdita
Asked:
foreverdita
2 Solutions
 
TintinCommented:
You can delete any of the files ending in a number.

access_log and error_log will be open and actively being written to (assuming apache is running).

You can save lots of space if you compress rotated files.

Edit /etc/logrotate.conf and uncomment the line

#compress
0
 
wesly_chenCommented:
> 2 - Can I change what is being logged so they do not get so big?
Edit /etc/httpd/conf/httpd.conf    (the path of httpd.conf may vary)
CustomLog  logs/access_log common

This will make you access_log file smaller.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now