“Bagaiana caranya supaya Web Statistik kita bisa diakses oleh publik tanpa harus login ke Cpanel?”
1. Download Awstats_Access.zip
2. Setelah itu upload dan extract di folder public_html anda contohnya akan menjadi /home/useranda/public_html/stats
3. Edit file “config.php” yang ada di folder /home/useranda/public_html/stats
<?php
$username = “user”; /* Sesuaikan dengan keinginan anda*/
$password = “pass”; /* Sesuaikan dengan keinginan anda */
$site = “yoursite.com”; /*Sesuaikan dengan nama domain anda */
$cpnlusername = “cpanelusername”;
$cpnlpassword = “cpanelpassword”;
?>
4. Setelah itu silahkan akses http://namadomainanda.com/stats
Untuk login gunakan username dan password seperti yang telah ditentukan difile “config.php” sebelumnya.
“Bagaimana caranya supaya mengakses Web Statistik tsb (http://namadomainanda.com/stats) tanpa menggunakan Authentifikasi ?”
Cukup dengan mengedit file “index.php” yang berada di folder stats tadi. Anda cukup menghapus bagian :
if (!isset($PHP_AUTH_USER)) {
header(‘WWW-Authenticate: Basic realm=”Site Statistics”‘);
header(‘HTTP/1.0 401 Unauthorized’);
echo ‘Authorization Required.’;
exit;
} else if (isset($PHP_AUTH_USER)) {
if (($PHP_AUTH_USER != $username) || ($PHP_AUTH_PW != $password)) {
header(‘WWW-Authenticate: Basic realm=”Site Statistics”‘);
header(‘HTTP/1.0 401 Unauthorized’);
echo ‘Authorization Required.’;
exit;
}
else {
sehingga hanya menjadi
<?php
require_once(“config.php”);
if($QUERY_STRING == “”){$query = “config=$site”;}else{$query=$QUERY_STRING;};
$Previous = false;
if(isset($_POST))
{
foreach($_POST as $key => $value)
{
if($Previous)
{
$POSTED .= “&”;
}
$POSTED = “$key=$value”;
$Previous = true;
}
}
$Curl = curl_init();
curl_setopt($Curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($Curl, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($Curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($Curl, CURLOPT_URL, “https://$site:2083/awstats.pl?$query”);
curl_setopt($Curl, CURLOPT_USERPWD, “$cpnlusername:$cpnlpassword”);
if(isset($_POST))
{
curl_setopt($Curl, CURLOPT_POST, TRUE);
curl_setopt($Curl, CURLOPT_POSTFIELDS, $POSTED);
}
curl_setopt($Curl, CURLOPT_RETURNTRANSFER, 1);
$results = curl_exec($Curl);
echo curl_error($Curl);
curl_close ($Curl);
for ($i = 0; $i < count($return_message_array); $i++) {
$results = $results.$return_message_array[$i];
}
if($query == “config=$site”){$results = str_replace(“src=\”", “src=\”?”, $results);}
if($framename==index){$results = str_replace(“src=\”", “src=\”index.php?”, $results);}
$results = str_replace(“action=\”", “action=\”index.php?”, $results);
$results = str_replace(“href=\”", “href=\”?”, $results);
$results = str_replace(“href=\”?http://”, “href=\”http://”, $results);
$results = str_replace(“awstats.pl?”, “”, $results);
$results = str_replace(“src=\”/images”, “src=\”images”, $results);
echo $results;
?>
Catatan :
Untuk lebih amannya sebaiknya file config.php diletakkan di folder /home/useranda/
setelah itu edit file index.php require_once(“config.php”); menjadi require_once(“/home/useranda/config.php”);













{ 5 comments… read them below or add one }
ada kendala di curl_init() nya,
not find curl function
gmn cara mengatasi nya ya ??
thx
Coba file configurasi ulang, silahkan download filenya di http://download.titik.org/awstat/Awstats_Access.zip
untuk file confignya diedit sehingga menjadi seperti http://download.titik.org/awstat/config.txt
lalu replace file index.php stats nya dengan http://download.titik.org/awstat/index.txt . Jangan lupa file config anda di letakkan diatas folder public_html (sebisa mungkin) untuk alasan security.
hallo…
saya coba kok yang nampil nge blank aja.. gk ada tulisan apa2…
tolong direview http://www.kopegtelrajawali.com
apa yang salah ya ?
pastikan php anda fungsi curl nya di enable
Coba cek access log atau error log nya…. pesan errornya apa?