Difference between revisions of "Rocky 9.x Control Web Panel Restoration"

From Notes_Wiki
(Created page with "= CWP Restoration Credentials Issues = After restoring the MySQL and /var/vmail/ directories from the mail rsnapshot server, an issue occurred while trying to access the CWP web interface at: https://<ip address>:2031/ == Problem == After restoring the old MySQL data onto the new CWP test server, we encountered a permission error with both MySQL and Postfix. * We were unable to access MySQL. * The credentials required to connect were not available. * Unfortunately,...")
 
(No difference)

Latest revision as of 12:19, 10 July 2025

CWP Restoration Credentials Issues

After restoring the MySQL and /var/vmail/ directories from the mail rsnapshot server, an issue occurred while trying to access the CWP web interface at:

https://<ip address>:2031/

Problem

After restoring the old MySQL data onto the new CWP test server, we encountered a permission error with both MySQL and Postfix.

  • We were unable to access MySQL.
  • The credentials required to connect were not available.
  • Unfortunately, we did not have the original MySQL server's credentials.

Solution

Step 1: Reset MySQL Root Password

Run the following command to reset the MySQL root password:

/scripts/mysql_pwd_reset -q

Example output:

After running above command we can set the new password.
MySQL root password has been successfully changed!
New MySQL root password is: <password>

To verify the new password, check the configuration file:

cat /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php

After resetting the password, we were able to successfully access the CWP web console.

Step 2: Roundcube Webmail Issue

While trying to access Roundcube Webmail, an error occurred (specific error message not shown).

Step 3: Postfix Authentication Issue

To retrieve the Postfix database credentials, run:

cat /etc/postfix/mysql-virtual_mailbox_maps.cf

Example output:

hosts = localhost
user = postfix
password = <new password>
dbname = postfix
query = SELECT ... (truncated)

Try logging into MySQL using the retrieved credentials:

mysql -u postfix -p

If this fails, reset the Postfix MySQL user password:

mysql -u root -p

Inside MySQL, run:

ALTER USER 'postfix'@'localhost' IDENTIFIED BY 'RnbiAVtx5fDf';

Then try again:

mysql -u postfix -p

Step 4: Check Mail Permissions

Run the CWP script to fix mail permissions:

/scripts/cwp_api account mail-fix-permission

Restart the necessary services:

systemctl restart cwpsrv dovecot postfix.service

Final Step

Now try to log in to Roundcube Webmail at:

https://<ip address>:2031/roundcube

using your email credentials.

Outcome

After following the above steps, I was able to successfully access the Roundcube Webmail interface.