0

I was running my Apache server on RHEL 5.5, and noticed when I typed: df -h, that I was getting:

[root@localhost log]# df -h
Filesystem            Size      Used   Avail  Use%   Mounted on
/dev/mapper/VolGroup00-LogVol00
                      11G       11G    0      100%   /
/dev/sda1             99M       13M    82M    14%    /boot
tmpfs                 1006M     0      1006M  0%     /dev/shm

Any idea where the space would be going to?

I have cleaned out the log files in /usr/local/apache2/logs/, but that hasn't cleaned up the space.

It has got to be a log file somewhere, but I can't find it.

Is there a command I can use to search / for the large files?

I have tried:

# du -a /var | sort -n -r | head -n 10

No luck.

  • 4
    As well as removing the log files, did you restart apache? Until you do, the kernel won't be able to free the disk space they occupied. – D_Bye Aug 27 '14 at 8:09
  • Thanks @D_Bye, I had to restart the Apache Server, and that worked. – Kevdog777 Aug 27 '14 at 8:31
  • Is there any way I can switch off logging on the server now? I commented the lines out in the httpd.conf file. – Kevdog777 Aug 27 '14 at 8:32
  • 1
    See here on how to find the large files and/or directories: unix.stackexchange.com/questions/140367/… – slm Aug 27 '14 at 8:54
  • 1
    @Kevdog777 That should do it. – D_Bye Aug 27 '14 at 10:29
0

The issue was that Apache was still writing to a certain log file: access_log. I commented that out, using the # tag, and after running a full weekend using the Apache server, it did not run out of space.

I typed: df -h on Friday and got this:

[root@localhost logs]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       11G  9.3G  817M  93% /
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                1006M     0 1006M   0% /dev/shm

Then this morning (Monday), I typed: df -h and got this:

[root@localhost logs]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       11G  9.3G  816M  93% /
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                1006M     0 1006M   0% /dev/shm

For me to find the other log file, I had to:

[root@localhost conf]# grep access_log httpd.conf 
# with "/", the value of ServerRoot is prepended -- so 'log/access_log'
# server as '/www/log/access_log', where as '/log/access_log' will be
# interpreted as '/log/access_log'.
    CustomLog "logs/access_log" common
    #CustomLog "logs/access_log" combined

As you can see, CustomLog "logs/access_log" common is not commented out. That file gets really big.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.