Have you wanted to update your Awstats page in the browser but the button is missing? Have you edited the configuration file just to have the button disappear the next day? After a lot of aggravation this is how I solved the problem.
First the setting to allow updates from the browser is located in the .conf file for Awstats. Mine is named awstats.yourdomainname.com.conf and is located in the /tmp/awstats directory on my host. If your hosts uses cpanel you can use the file browser to edit this file directly on the site. If not any text editor will work. The setting that needs to be changed is “AllowToUpdateStatsFromBrowser=0” located on or around line 37. Simply Change the 0 to a 1 and save the document. Refresh your browser on the Awstats page and you will see the “Update now” button will magically appear.
Keeping the darn button there……..
As many of us have learned this solution works great however some hosts overwrite this file every day. After a few months of editing that .conf file just to update your stats you will be looking for another solution. In a shared hosting environment we don’t have much access to the server itself so it’s time to get creative.
I started by trying to use a cron job to overwrite the file with a cp command. Even with a force flag this did not work at all. I finally settled on copying the file from an external location using FTP. Here are the steps..
- Setup an ftp user that has a home directory of tmp/awstats
- Download FtpUse and install it on your outside server or computer that’s always on.
- Change the .conf file so that browser updates are allowed and save a local copy. For my example I put it in the root of c:\
- Now we need to create a batch file that will map a drive to your ftp site and copy the local file to the web host. Here’s an example that creates a drive with the letter “o:”
ftpuse o: ftp.yourdomain.com yourpass /USER:firstname.lastname@example.org /PORT:21
copy /Y C:\awstats.yourdomain.com.conf o:\awstats.yourdomain.com.conf
Note: The ping command is in the file as a delay to prevent the copy command from launching before the drive is mapped.
- Finally schedule a task in windows to run this batch file shortly after the file is overwritten everyday. This will be the “Last Update” time that your used to seeing on the page before you could update manually.
That’s all there is to it. Now when you login the button should always be there. Let me know how it works for you. Also if you happen to get the cron method to work I would like the hear about that as well.