<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; apache log files</title> <atom:link href="http://www.ghacks.net/tag/apache-log-files/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>How To Deal With Huge Apache Web Server Log Files</title><link>http://www.ghacks.net/2008/10/01/how-to-deal-with-huge-apache-web-server-log-files/</link> <comments>http://www.ghacks.net/2008/10/01/how-to-deal-with-huge-apache-web-server-log-files/#comments</comments> <pubDate>Wed, 01 Oct 2008 07:37:08 +0000</pubDate> <dc:creator>Martin Brinkmann</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Operating Systems]]></category> <category><![CDATA[apache log analysis]]></category> <category><![CDATA[apache log files]]></category> <category><![CDATA[apache server]]></category> <category><![CDATA[apache web server]]></category> <category><![CDATA[dedicated server]]></category> <category><![CDATA[log file analysis]]></category> <category><![CDATA[log files]]></category> <category><![CDATA[root server]]></category> <category><![CDATA[web server]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=7325</guid> <description><![CDATA[I must admit that I have not been paying attention to the size of some of the Apache web server log files on my dedicated server. For those that do not know, the Apache logs are the log files of the Apache web server. They log every hit to a website and provide excellent material [...]]]></description> <content:encoded><![CDATA[<p>I must admit that I have not been paying attention to the size of some of the Apache web server log files on my dedicated server. For those that do not know, the Apache logs are the log files of the Apache web server. They log every hit to a website and provide excellent material that can be processed by a log file analysis software.</p><p>This log files can become huge if you have a popular website. The current size of the Ghacks log file is 45 Gigabytes. If it continues growing in that pace the web server will run out of hard disk space pretty soon.</p><p>The first problem was to figure out how to backup the 45 Gigabyte file on the web server since I did not want to loose all the data stored within. The idea was born to compress the Apache web server log file first and then reduce it to a few Kilobytes with the echo command.</p><p><span
id="more-7325"></span>The Apache web server log files are stored in the /var/log/apache2 directory on the Debian dedicated server. The first command to issue would compress the contents of the apache2 directory into multiple tar files if the compressed file reaches a size maximum. This makes it easier to transfer files to another computer.</p><p><code>tar -cz directory | split -d -b 1024m - destination.tgz</code></p><p>Directory is the source directory where the Apache web server log files reside and destination.tgz is the name of the to be created compressed file. It is important to note that you might need to stop the Apache web server for the operation to succeed because the compression utility will stop if files get changed during procession.</p><p>The last thing that is to be done is to clear the original Apache web server log files in the log files directory. This can be done with the following command even if Apache is running.</p><p><code>echo " " > /var/log/apache2/filename.log</code></p><p>This simply overwrites the contents of the file. Please note again that some Linux distributions use another directory structure and that the log files can be located in another directory on the server.<br
/> This takes only a few seconds and the log file will be cleared from all contents afterwards.</p><p>Then it is just a matter of transferring the various compressed archives to another computer.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2008/10/01/how-to-deal-with-huge-apache-web-server-log-files/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
