• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Plesk Web Stats password change

C

Coldfusion2006

Guest
I have noticed that when I first create a new domain on my server and choose to provide that domain with "Web Stats" all of the ftp passwords and user names are assigned to the "Web Stats" access page.

While that is fine by me and works great, I have noticed something that does not work.

Updating passwords on FTP accounts doesn't seem to carry over to the Web Stats access pages. Basically if I started off with a user name and password of:

user123
pass123

Then change to:

user543
pass543

It doesnt work with "Web Stats" and I can still access "Web Stats" using the old info that I originally setup.

Even if I restart Apache it doesn't help. Does any one know why this would be happening or if there is something that I am missing?

Thanks in Advance!
 
Fix for Statistics Passwords

Paste the following script in a file named 'psa_statpass.php', and chmod that file to 700.
Execute te script every day (for example using Crontab):

PHP:
#!/usr/bin/php
<?

$ADMIN_PASS=trim(file_get_contents("/etc/psa/.psa.shadow"));
$PRODUCT_ROOT_D=trim(shell_exec('grep PRODUCT_ROOT_D /etc/psa/psa.conf | awk \'{print $2}\''));

$dbres = mysql_connect("localhost", "admin", $ADMIN_PASS);
if (false == $dbres)
{
  FatalError("Can't connect to MySQL server");
}

if (!mysql_select_db("psa",$dbres))
{
  FatalError("Error selecting database.");
}


$result = mysql_query("
SELECT d.`name` , s.`login` , a.`password`
FROM `hosting` h
INNER JOIN `domains` d ON d.`id` = h.`dom_id`
INNER JOIN `sys_users` s ON s.`id` = h.`sys_user_id`
INNER JOIN `accounts` a ON a.`id` = s.`account_id` /* WHERE d.`name` = '[VARIABLE]' */
ORDER BY d.`name`
",$dbres);

if (false ===  $result)
{
  FatalError("Error executing query");
}

while ($qrow = mysql_fetch_array($result, MYSQL_ASSOC))
{
  $domain = $qrow['name'];
  $login = $qrow['login'];
  $pass = $qrow['password'];
  #print "\nDomain: $domain\n";
  shell_exec("$PRODUCT_ROOT_D/bin/domain.sh -u '$domain' -webstat-protdir-access 'true'\n");
  shell_exec("$PRODUCT_ROOT_D/bin/protdir.sh -r 'plesk-stat' -domain '$domain'\n");
  shell_exec("$PRODUCT_ROOT_D/bin/protdir.sh -c 'plesk-stat' -domain '$domain' -type 'nonssl' -title 'Statistics'\n");
  shell_exec("$PRODUCT_ROOT_D/bin/protdir.sh -u 'plesk-stat' -domain '$domain' -add_user '$login' -passwd '$pass'\n");
}

mysql_free_result($result);
mysql_close($dbres);

exit;

##################################################

function FatalError($msg)
{
  print "\n\nFATAL ERROR: $msg\n\n";
  exit;
}

##################################################

?>

I just paste my solution here, sorry I don't have time to help everybody implementing it.

Kind regards, Jeroen Vermeulen - www.toneworks.nl (Dutch)
 
Back
Top