<?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>Robert Stinnett &#187; linux</title>
	<atom:link href="http://www.robertstinnett.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertstinnett.com</link>
	<description>In case of accidental reading, flush eyes with warm water for 5 minutes.</description>
	<lastBuildDate>Tue, 24 Jan 2012 02:03:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<cloud domain='www.robertstinnett.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Rotating Apache Logs &#8211; The Easy, Automatic Way</title>
		<link>http://www.robertstinnett.com/2009/02/07/rotating-apache-logs-the-easy-automatic-way/</link>
		<comments>http://www.robertstinnett.com/2009/02/07/rotating-apache-logs-the-easy-automatic-way/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 03:47:05 +0000</pubDate>
		<dc:creator>Robert Stinnett</dc:creator>
				<category><![CDATA[Tech Stuff]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[web hosting]]></category>

		<guid isPermaLink="false">http://www.robertstinnett.com/2009/02/07/rotating-apache-logs-the-easy-automatic-way/</guid>
		<description><![CDATA[Many of my friends that I’m strictly a Microsoft Windows guy – they don’t know about the secret Linux guy that hides inside.&#160; Most of the web properties that I own (including this one) run on Linux and are served up by Ubuntu.&#160; I get my “power” from Slicehost, the best darn virtual private server [...]]]></description>
			<content:encoded><![CDATA[<p>Many of my friends that I’m strictly a Microsoft Windows guy – they don’t know about the secret Linux guy that hides inside.&#160; Most of the web properties that I own (including this one) run on Linux and are served up by Ubuntu.&#160; I get my “power” from <a href="https://manage.slicehost.com/customers/new?referrer=77c9aed320baaffdd83d74a74f4976e3" target="_blank">Slicehost</a>, the best darn virtual private server provider out there.&#160; Long before I was a Windows guy I spent many an hour writing scripts and maintaining AIX systems.</p>
<p>Enough about that – onto the topic of this post.&#160; One of the things I like to do with my websites is rotate the Apache access log files every day so that I can more easily archive them and analyze them.&#160; Unfortunately, as common as you might think this is, it’s pretty darn hard to track down any documentation on how to do it.&#160; The thing is, once you find out how to do it, you realize how easy it is!</p>
<p>The trick is to use a program that comes with Apache 2.0 – rotatelogs.&#160; This guy can be found in your /usr/sbin directory on most flavors of Linux.&#160; You are going to take it and combine it with the CustomLogs directive in your configuration file to give you all the power you want.&#160; If you are running virtual hosts on your sites, you will want to put this in your configuration files for your particular site that are located in /etc/apache2/sites-enabled.&#160; (Unless you keep all your log files for all your sites in one big file, which I strongly recommend against.)</p>
<p>Note the following is all on one line, despite the fact it may appear to be on two in your web browser.</p>
<blockquote><p><strong>CustomLog &quot;| rotatelogs /var/www/virtualdir/log/access_log.%Y-%m-%d 86400&quot; combined</strong></p>
</blockquote>
<p><font style="background-color: #f4f5f7"></font></p>
<p>Replace your current CustomLog entry with the one above.&#160; Notice the pipe character “|” after the quotes.&#160; This will have Apache rotate your log files every 24 hours at midnight (86,400 seconds after midnight) and store them as access_log.2009-07-02 with the date portion changing every day.&#160; Unlike other solutions out there, this one will not require any restarting of your Apache server every day.&#160; You will need to use <strong><em>apache2ctrl restart</em></strong> to restart your web server after you made the changes to pick up the new configuration settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertstinnett.com/2009/02/07/rotating-apache-logs-the-easy-automatic-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

