Password Protecting GoDaddy Webalizer Stats in /usage

On October 18, 2008, in Technology, by Mike Waldron

At work I recently moved our hosting to a GoDaddy Linux Virtual Server utilizing Simple Control Panel/TurboPanel.  Everything worked fantastic with the exception of .htaccess/password protection for the Webalizer statistics located at /usage for each respective site.  GoDaddy support was clueless and couldn’t help.

I would place an .htaccess file in each site’s respective directory in /var/www/stats/sitename.com and it would still be accessible to the public.  The reason for this was that TurboPanel/Simple Control Panel was not placing the “AllowOverride All” option for the “usage” path in the /etc/httpd/conf.d/turbopanel.conf file. If you edit this file manually, TurboPanel will overwrite it next time you make a change to your configuration so that’s not a good solution.

After some Googling, I found an answer here which was slightly flawed, but saved me a ton of time figuring it out myself.  Utilizing the fix below you can permanently fix the TurboPanel configuration template to automatically add the “AllowOverride All” option when it generates the /etc/httpd/conf.d/turbopanel.conf file. This will enable the .htaccess file to work for /usage.

Using Nano/VI/Pico or any text editor (nano is used in my example):

nano /usr/share/turbopanel/webapp/WEB-INF/classes/     (continued on next line)
    com/godaddy/turbopanel/framework/systems/apache/apache-config.xsl

Find the following lines under "<!-- Webalizer -->":

<xsl:text>Allow from all</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$tab"/>
<xsl:value-of select="$lbracket"/>
<xsl:text>/Directory</xsl:text>
<xsl:value-of select="$rbracket"/>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
</xsl:when> 

Change the above to:

<xsl:text>Allow from all</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$tab"/>
<xsl:value-of select="$tab"/>
<xsl:text>AllowOverride All</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$tab"/>
<xsl:value-of select="$lbracket"/>
<xsl:text>/Directory</xsl:text>
<xsl:value-of select="$rbracket"/>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
</xsl:when>

After editing, restart TurboPanel and Apache:

/etc/init.d/turbopanel restart
/sbin/service httpd restart 
 

For good measure, after you’ve completed the above, go into “Simple Control Panel” and edit one of your sites.  Make sure Webalizer/statistics are enabled and click save.

Now when you place an .htaccess file in one of your statistic folders it will actually work!  Hooray!

Leave a comment if this helped you or if you have anything to add.


Tagged with:  

One Response to Password Protecting GoDaddy Webalizer Stats in /usage

  1. Ilene says:

    Hi webmaster i see you put a lot of work in your website,
    i know how to make your blogging easier, do you
    know that you can copy any article from any page, make it
    100% unique and pass copyscape test? For more
    details , just search in google – rewriter creates an unique
    article in a minute

Leave a Reply

Your email address will not be published. Required fields are marked *

Web Hosting