Page 1 of 1

Need help emptying Apache access log

PostPosted: 08. March 2012 18:57
by deck2deck
I am running XAMPP installed with the help of this website.

I'm not a programmer and really know nothing... I'm just able to follow instructions! I did get my site up and working and it has worked well now for over a year.

BUT I now have a new problem. I'm running out of disk space on my server! With a little investigation, I discovered that there is an Apache access log file that is 8GB big! That is why my site is running out of space.

I've searched online for nearly a week looking for an answer... I find many answers, but they are written for programmers and I have no idea how to begin (execute a script? run a cron job? I wouldn't even know where to start). :oops:

Can someone direct me to a step-by-step for fixing this problem? Thanks in advance!!

Re: Need help emptying Apache access log

PostPosted: 08. March 2012 21:54
by WilliL
Are you meaning c:\\xampp\apache\logs\access-log?
which xampp version are you using?

Re: Need help emptying Apache access log

PostPosted: 08. March 2012 23:13
by Sharley
@ deck2deck
Would you be so kind as to add your XAMPP version and Operating System to your profile as per these instructions and associated information:
viewtopic.php?f=16&t=48626
Thanks. :)

You simply delete the error.log and or the access.log file when Apache is stopped.

It will recreate them when you next start Apache.

Re: Need help emptying Apache access log

PostPosted: 09. March 2012 16:32
by deck2deck
Thanks WilliL and Sharley!

WilliL: Yes -- that is the file I'm referencing.

Sharley: I thought I might be able to do that (delete the files) but I have not found ANYthing anywhere, on any of the forums I've been on, that has said so (and I've been searching for a week!) And without seeing that in print (that they would simply recreate themselves), I was afraid to do it.

Thanks SO much!!

Sharley, I updated my profile as requested -- thanks. For the record, I'm using XAMPP 1.7.4 on a Windows 2008 R2 server (version 6.1). Hope that helps, and I will try your suggestion. Appreciate your time!!

Re: Need help emptying Apache access log

PostPosted: 09. March 2012 21:15
by Sharley
Thanks for fixing up your profile, it really does help us help you knowing those 2 important details.

And without seeing that in print (that they would simply recreate themselves), I was afraid to do it.
:shock: ...but you are seeing it in print in the only place that is official, the XAMPP Support Forums, anywhere else is not an official XAMPP response and should possibly be viewed with caution anyway, with the exception, of course, of the XAMPP's component web sites like Apache, MySQL and PHP etc.

If you are worried about Apache recreating those 2 log files automagically when you start Apache again and I can assure you Apache will, then alternatively you can simply delete all the file's content without deleting the actual file, but again you can only do this when Apache is stopped as Apache has the file(s) open when running so it can add any relevant messages in real time.

Best wishes. :)

Re: Need help emptying Apache access log

PostPosted: 10. March 2012 00:13
by hackattack142
A good place to usually start is the official documentation for a module. It would have also given you the information you were looking for (log rotate section) http://httpd.apache.org/docs/2.2/logs.html