<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Net Builders - Programming</title>
		<link>http://www.netbuilders.org/</link>
		<description>Programming for the Web (HTML, CSS, PHP, Perl, Python, Ruby, JavaScript, ASP, etc...)</description>
		<language>en</language>
		<lastBuildDate>Sun, 19 May 2013 15:11:38 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.netbuilders.org/images/misc/rss.png</url>
			<title>Net Builders - Programming</title>
			<link>http://www.netbuilders.org/</link>
		</image>
		<item>
			<title>AW Stats Code</title>
			<link>http://www.netbuilders.org/programming/aw-stats-code-30764.html</link>
			<pubDate>Mon, 22 Apr 2013 16:53:03 GMT</pubDate>
			<description><![CDATA[Some code to spit out awstats config files from your Apache vhosts file ("hosts.conf") based on a template ("awstats.conf") 
 
PHP: 
--------- 
<?php...]]></description>
			<content:encoded><![CDATA[<div><!-- google_ad_section_start -->Some code to spit out awstats config files from your Apache vhosts file (&quot;hosts.conf&quot;) based on a template (&quot;awstats.conf&quot;)<br />
<div class="bbcode_container">
	<div class="bbcode_description">PHP Code:</div>
	<hr /><code class="bbcode_code"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;*&nbsp;Generates&nbsp;awstats&nbsp;config&nbsp;files&nbsp;*&nbsp;LogFile="C:/Apache24/logs/mysite-access.log"&nbsp;*&nbsp;SiteDomain="mysite.com"&nbsp;*/<br /></span><span style="color: #0000BB">$hosts&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">"hosts.conf"</span><span style="color: #007700">);</span><span style="color: #0000BB">$conf&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">file_get_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">"awstats.conf"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">preg_match_all</span><span style="color: #007700">(</span><span style="color: #DD0000">"@ServerName&nbsp;(&#91;.\-a-z1-9&#93;+)@"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$hosts</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$matches</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">preg_match_all</span><span style="color: #007700">(</span><span style="color: #DD0000">"@CustomLog&nbsp;logs/(&#91;-a-z1-9&#93;+)-access.log&nbsp;combined@"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$hosts</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$matches2</span><span style="color: #007700">);<br />foreach(</span><span style="color: #0000BB">$matches</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">1</span><span style="color: #007700">&#93;&nbsp;as&nbsp;</span><span style="color: #0000BB">$key&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$domain</span><span style="color: #007700">){&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$content&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">"LogFile=\"C:/Apache24/logs/%s-access.log\"\nSiteDomain=\"%s\"\n%s"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$matches2</span><span style="color: #007700">&#91;</span><span style="color: #0000BB">1</span><span style="color: #007700">&#93;&#91;</span><span style="color: #0000BB">$key</span><span style="color: #007700">&#93;,&nbsp;</span><span style="color: #0000BB">$domain</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$conf</span><span style="color: #007700">);&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">file_put_contents</span><span style="color: #007700">(</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">"awstats.%s.conf"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$domain</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">$content</span><span style="color: #007700">);}</span><span style="color: #0000BB">?&gt;</span>
</span>
</code></code><hr />
</div><!-- google_ad_section_end --></div>

]]></content:encoded>
			<category domain="http://www.netbuilders.org/programming/">Programming</category>
			<dc:creator>Andy101</dc:creator>
			<guid isPermaLink="true">http://www.netbuilders.org/programming/aw-stats-code-30764.html</guid>
		</item>
	</channel>
</rss>
