How to display Awstats publicly in Linux shared hosting?
Though, there is no direct way of displaying statistics of your domain on your website, you can use the below Script to accomplish this:
$user = 'username'; //your cpanel username
$pass = 'password'; //your cpanel password
$domain = 'website.com'; //do not include 'http://' or 'www.'
NO NEED TO TOUCH ANYTHING BELOW HERE
//retrieves the file, either .pl or .png
global $user, $pass, $domain;
//it's a .png file...
$fileQuery = $_SERVER['QUERY_STRING'];
//probably first time to access page...
$fileQuery = "awstats.pl?config=$domain";
//otherwise, all other accesses
$fileQuery = 'awstats.pl?'.$_SERVER['QUERY_STRING'];
//now get the file
$file = getFile($fileQuery);
//check again to see if it was a .png file
//if it's not, replace the links
$file = str_replace('awstats.pl', basename($_SERVER['PHP_SELF']), $file);
$file = str_replace('="/images','="'.basename($_SERVER['PHP_SELF']).'?images',$file);
//if it is a png, output appropriate header
//output the file
Note: This script requires that you save your cpanel username and password in the php file, which is a security risk. Thus, users are requested to use this script at their own risk. Cyberspace Indonesia has not written this script, thus it will not provide any support for any issues arising out of the usage of this script.
NOTE: This article is for the cPanel users only.
Was this answer helpful?
No, due to security reasons, we do not provide remote MySQL in Linux Shared Hosting.
Pointing one domain to another domain is called Domain Parking. For e.g. yourdomain.com ->...
In Linux Shared Hosting, we have restricted the upload size limit to 2 MB but we can raise it to...
By default the web-contents will be loaded from public_html directory of your domain. If you want...
No, we do not provide SFTP (Secure FTP over SSH). However, we support, FTPS (FTP over explicit...