<?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>Atlas-Tuesday &#187; clustering</title>
	<atom:link href="http://www.atlas-tuesday.com/tag/clustering/feed" rel="self" type="application/rss+xml" />
	<link>http://www.atlas-tuesday.com</link>
	<description>The adventures of Dustin Wright in the IT world.</description>
	<lastBuildDate>Thu, 31 Dec 2009 14:26:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>AWstats in a clustered environment</title>
		<link>http://www.atlas-tuesday.com/awstats-in-a-clustered-environment</link>
		<comments>http://www.atlas-tuesday.com/awstats-in-a-clustered-environment#comments</comments>
		<pubDate>Tue, 17 Feb 2009 16:02:50 +0000</pubDate>
		<dc:creator>dwright</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[awstats]]></category>
		<category><![CDATA[clustering]]></category>
		<category><![CDATA[nfs]]></category>

		<guid isPermaLink="false">http://www.atlas-tuesday.com/?p=47</guid>
		<description><![CDATA[Detailed setup instructions for configuring awstats in a cluster environment using centos and NFS.]]></description>
			<content:encoded><![CDATA[<p><!--[if gte mso 9]><xml> <w :WordDocument> </w><w :View>Normal</w> <w :Zoom>0</w> <w :PunctuationKerning /> <w :ValidateAgainstSchemas /> <w :SaveIfXMLInvalid>false</w> <w :IgnoreMixedContent>false</w> <w :AlwaysShowPlaceholderText>false</w> <w :Compatibility> <w :BreakWrappedTables /> <w :SnapToGridInCell /> <w :WrapTextWithPunct /> <w :UseAsianBreakRules /> <w :DontGrowAutofit /> </w> <w :BrowserLevel>MicrosoftInternetExplorer4</w> </xml>< ![endif]--><!--[if gte mso 9]><xml> <w :LatentStyles DefLockedState="false" LatentStyleCount="156"> </w> </xml>< ![endif]--><!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]> <mce :style>< !   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} --> <!--[endif]--></p>
<p class="MsoNormal"><!--[if gte mso 9]><xml> <w :WordDocument> </w><w :View>Normal</w> <w :Zoom>0</w> <w :PunctuationKerning /> <w :ValidateAgainstSchemas /> <w :SaveIfXMLInvalid>false</w> <w :IgnoreMixedContent>false</w> <w :AlwaysShowPlaceholderText>false</w> <w :Compatibility> <w :BreakWrappedTables /> <w :SnapToGridInCell /> <w :WrapTextWithPunct /> <w :UseAsianBreakRules /> <w :DontGrowAutofit /> </w> <w :BrowserLevel>MicrosoftInternetExplorer4</w> </xml>< ![endif]--><!--[if gte mso 9]><xml> <w :LatentStyles DefLockedState="false" LatentStyleCount="156"> </w> </xml>< ![endif]--><!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]> <mce :style>< !   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} --> <!--[endif]--></mce></p>
<p class="MsoNormal"><!--[if gte mso 9]><xml> <w :WordDocument> </w><w :View>Normal</w> <w :Zoom>0</w> <w :PunctuationKerning /> <w :ValidateAgainstSchemas /> <w :SaveIfXMLInvalid>false</w> <w :IgnoreMixedContent>false</w> <w :AlwaysShowPlaceholderText>false</w> <w :Compatibility> <w :BreakWrappedTables /> <w :SnapToGridInCell /> <w :WrapTextWithPunct /> <w :UseAsianBreakRules /> <w :DontGrowAutofit /> </w> <w :BrowserLevel>MicrosoftInternetExplorer4</w> </xml>< ![endif]--><!--[if gte mso 9]><xml> <w :LatentStyles DefLockedState="false" LatentStyleCount="156"> </w> </xml>< ![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:Wingdings; 	panose-1:5 0 0 0 0 0 0 0 0 0; 	mso-font-charset:2; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:0 268435456 0 0 -2147483648 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:1028527419; 	mso-list-type:hybrid; 	mso-list-template-ids:-1326121586 1310750156 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l0:level1 	{mso-level-start-at:3; 	mso-level-number-format:bullet; 	mso-level-text:-; 	mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --><!--[if gte mso 10]> <mce :style>< !   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} --> <!--[endif]--></mce></p>
<p>Below is a simple solution for operating AWstats within a clustered environment in CentOS 5. This solution should work for other operating systems as well. This explanation assumes you’ll be using two application nodes, with front-end directors. I have not tried this solution using three nodes.</p>
<ul>
<li>Install AWstats &amp; NFS from yum repository.</li>
<li>Create profile for your domain within /etc/awstats. (i.e. awstats.www.domain.com.conf)</li>
<li>Configure NFS mounts on each node. This can be accomplished by modifying your /etc/fstab file as illustrated below.</li>
<li>Adjust your awstats configuration file to point at both log sources now that the NFS mount has been created.</li>
<li>On second node, mount /var/lib/awstats</li>
<li>Configure nightly cron on first application node.</li>
<li>Configure calling either awstats.pl should display the data processed data stored on node 1, regardless of which node the user is accessing.</li>
</ul>
<p>Notes / Exceptions</p>
<p>Be sure to backup your Apache log files, and your AWstats data. In this solution the processed information will only be stored on the primary node</p>
<p>Full Setup Process</p>
<pre>1. SSH APP1
2. yum install awstats nfs -y
3. nano /etc/exports
4. <strong>Add following lines:
</strong>/var/log/httpd APP2(rw,sync)
/var/lib/awstats APP2(rw,sync)
/etc/awstats APP2(rw,sync)
5. nano /etc/fstab
6a. <strong>Add lines, </strong>APP2:/var/log/httpd /var/log/httpd-APP2 nfs rsize=16384,wsize=16384 0 0
6b. mount /var/log/httpd-APP2
7. ln -s /var/log/httpd /var/log/httpd-APP1
8. service nfs start
9. chkconfig nfs on
10. cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.www.domain.com.conf
11. nano /etc/awstats/awstats.www.domain.com.conf
12. <strong>Configure normally, exception add</strong>
LogFile="/usr/local/awstats/tools/logresolvemerge.pl /var/log/httpd-APP1/domain.com-access_log \
    /var/log/httpd-APP2/domain.com-access_log |"<!--[if gte mso 9]><xml>
 <w :WordDocument>
  </w><w :View>Normal</w>
  <w :Zoom>0</w>
  <w :PunctuationKerning />
  <w :ValidateAgainstSchemas />
  <w :SaveIfXMLInvalid>false</w>
  <w :IgnoreMixedContent>false</w>
  <w :AlwaysShowPlaceholderText>false</w>
  <w :Compatibility>
   <w :BreakWrappedTables />
   <w :SnapToGridInCell />
   <w :WrapTextWithPunct />
   <w :UseAsianBreakRules />
   <w :DontGrowAutofit />
  </w>
  <w :BrowserLevel>MicrosoftInternetExplorer4</w>

</xml>< ![endif]-->
13. SSH APP2
14. yum install awstats nfs -y
15. nano /etc/exports
16. <strong>Add following lines:
</strong>/var/log/httpd APP1(rw,sync)
/var/lib/awstats APP1(rw,sync)
/etc/awstats APP1(rw,sync)
17. nano /etc/fstab
18a. <strong>Add following lines,
</strong>APP1:/var/log/httpd /var/log/httpd-APP1 nfs rsize=16384,wsize=16384 0 0
APP1:/var/lib/awstats /var/lib/awstats nfs rsize=16384,wsize=16384 0 0
18b. mount /var/log/httpd-APP1
18c. mount /var/lib/awstats
19. ln -s /var/log/httpd /var/log/httpd-APP2
20. service nfs start
21. cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.www.domain.com.conf
22. nano /etc/awstats/awstats.www.domain.com.conf
23. <strong>Configure normally, exception add</strong>
LogFile="/usr/local/awstats/tools/logresolvemerge.pl /var/log/httpd-APP1/domain.com-access_log \
    /var/log/httpd-APP2/domain.com-access_log |"<!--[if gte mso 9]><xml>
 <w :WordDocument>
  </w><w :View>Normal</w>
  <w :Zoom>0</w>
  <w :PunctuationKerning />
  <w :ValidateAgainstSchemas />
  <w :SaveIfXMLInvalid>false</w>
  <w :IgnoreMixedContent>false</w>
  <w :AlwaysShowPlaceholderText>false</w>
  <w :Compatibility>
   <w :BreakWrappedTables />
   <w :SnapToGridInCell />
   <w :WrapTextWithPunct />
   <w :UseAsianBreakRules />
   <w :DontGrowAutofit />
  </w>
  <w :BrowserLevel>MicrosoftInternetExplorer4</w>

</xml>< ![endif]-->
24. SSH APP1
25. crontab -e <strong>add line,</strong> perl /usr/local/awstats/tools/awstats_updateall.pl now
26. Configure Apache to expose awstats.pl, refer to awstats setup for additional information.
27. Confirm setup (df -h, perl awstats.pl -update -config=www.domain.com)</pre>
<p>This should allow users accessing either node to display the same stats information compiled from both nodes access logs. Be sure to do backups!<br />
Enjoy,<br />
Dustin</mce></p>
]]></content:encoded>
			<wfw:commentRss>http://www.atlas-tuesday.com/awstats-in-a-clustered-environment/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
