Access Log Question

Posted on 2005-05-10
Last Modified: 2010-04-20
I have a linux server with the following access / error / ssl log files:


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.

Question by:foreverdita
    LVL 48

    Accepted Solution

    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

    LVL 38

    Assisted Solution

    > 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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now