RoundCube reinstallation

Hello, I’m new to hestia. I just setup a server and had some issue with the roundcube installation/webmail panel. I followed one of the instructions to use apt-get to reinstall roundcube but that looks to have deleted the database.

I have not found a way to reinstall roundcube and reinitialize the service. Is there docs or instructions on how to do so?

The error I have is:

DATABASE ERROR!

Unable to connect to the database!
Please contact your server-administrator.

Hi @johnv,

What problem?

You should not install roundcube using apt, if you did it remove it.

apt remove roundcube

As I don’t know what you did, just in case it exists, delete db, db user and one file in roundcube installation (Hestia script v-add-sys-roundcube will remove all later):

mysql -uroot -e 'DROP DATABASE IF EXISTS roundcube'
mysql -uroot -e 'DROP USER 'roundcube'@'localhost''
rm /var/lib/roundcube/index.php

Now install roundcube:

v-add-sys-roundcube

Change perms:

chown -R hestiamail:www-data /etc/roundcube/
find /etc/roundcube/ -type f -iname "*php" -exec chmod 640 {} \;
chown -R hestiamail:www-data /var/lib/roundcube/
chown -R hestiamail:www-data /var/log/roundcube/

Try to access webmail.

1 Like

Thank you for the response. I’ve run through this. I’ve run into the following error.

v-add-sys-roundcube

ERROR: Install done from apt source, unable to continue

Did you follow the steps I posted above before running v-add-sys-roundcube?

Yes, I did. I was able to get around and run v-add-sys-roundcube by removing /usr/share/roundcube

Continued with the instructions and it looks like the website is working. Thank you!

1 Like

root@admin:/usr/local/hestia/web# v-add-sys-roundcube
PHP Fatal error: Uncaught Error: Class “PHPMailer\PHPMailer\PHPMailer” not found in /usr/local/hestia/web/inc/main.php:434
Stack trace:
#0 /usr/local/hestia/web/inc/mail-wrapper.php(39): send_email()
#1 {main}
thrown in /usr/local/hestia/web/inc/main.php on line 434
Error: Connection to localhost failed

v-add-sys-dependencies

should install php mailer…

Error: Connection to localhost failed

Looks like mysql is not running…

If MySQL is not working, would the wordpress system be working? It must be something else. When I checked status I didn’t see a problem, where else can I check?

root@admin:~# systemctl status mysql
● mariadb.service - MariaDB 10.11.7 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor prese> Drop-In: /etc/systemd/system/mariadb.service.d
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Sun 2024-02-11 16:08:38 +03; 3h 11min ago
Docs: man:mariadbd(8)
systemd - MariaDB Knowledge Base
Process: 801 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/> Process: 831 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_STA> Process: 864 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && V> Process: 1111 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_S> Process: 1131 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/> Main PID: 1035 (mariadbd)
Status: “Taking your SQL requests now…”
Tasks: 9 (limit: 14655)
Memory: 119.6M
CPU: 5.942s
CGroup: /system.slice/mariadb.service
└─1035 /usr/sbin/mariadbd
Feb 11 16:08:36 admin.upcreate.art systemd[1]: Starting MariaDB 10.11.7 databas>Feb 11 16:08:38 admin.upcreate.art systemd[1]: Started MariaDB 10.11.7 database>Feb 11 16:08:38 admin.upcreate.art /etc/mysql/debian-start[1140]: Upgrading MyS>Feb 11 16:08:38 admin.upcreate.art /etc/mysql/debian-start[1156]: Reading datad>Feb 11 16:08:38 admin.upcreate.art /etc/mysql/debian-start[1156]: ERROR 1045 (2>Feb 11 16:08:38 admin.upcreate.art /etc/mysql/debian-start[1156]: FATAL ERROR: >Feb 11 16:08:38 admin.upcreate.art /etc/mysql/debian-start[1216]: Checking for >Feb 11 16:08:38 admin.upcreate.art debian-start[1221]: ERROR 1045 (28000): Acce>lines 1-28/28 (END)

Did you change the root password?

No, I’m still using my old password. Two days ago, the server company crashed due to a malfunction and I took backups and formatted it. Then I reinstalled everything, but the mail system didn’t work, connection problems, etc. I got a lot of errors. It took a lot of time to try to solve it, so I decided to take backups again and format it, but I’m having trouble taking backups. In the other issue I opened, there is an error I got during the backup process, it says something like MySQL connection could not be established. But the web pages can pull data from the database, I honestly don’t fully understand the problem.

The only thing I did differently in the last format was that I included postgreesql as an extra when installing hestia. I wonder if this will cause problems? All other settings are the same, hostname, password, port and others

Hello,

today i reformatted the server and uploaded the backups. i didn’t get any problems everything works but roundcube is not working again. i checked the logs but the folder is empty there are no files.

I did the method you wrote:

 apt-get --reinstall install roundcube 

It asked for the database password, I used the password I saw in config.inc.php but it didn’t work.

What can I try now or where can I look?

Don’t use apt-get --reinstall install roundcube it shouldn’t be needed.

v-add-sys-roundcybe should be enough…

root@admin:~# v-add-sys-roundcube
ERROR: Install done from apt source, unable to continue

This is the latest situation:

bro I need your help please let’s solve this problem without having to format again

Check apache log file
/var/log/apache2/error.log

there you will find the error
In my case it was
‘PHP message: PHP Warning: Undefined array key “temp_dir” in /var/lib/roundcube/program/lib/Roundcube/rcube_config.php on line 233; PHP message: PHP Warning: Undefined array key “temp_dir” in /var/lib/roundcube/program/lib/Roundcube/rcube_config.php on line 233; PHP message: PHP Warning: Undefined array key “drafts_mbox” in /var/lib/roundcube/program/lib/Roundcube/rcube_config.php on line 243; PHP message: PHP Warning: Undefined array key “junk_mbox” in /var/lib/roundcube/program/lib/Roundcube/rcube_config.php on line 243; PHP message: PHP Warning: Undefined array key “sent_mbox” in /var/lib/roundcube/program/lib/Roundcube/rcube_config.php on line 243; PHP message: PHP Warning: Undefined array key “trash_mbox” in /var/lib/roundcube/program/lib/Roundcube/rcube_config.php on line 243; PHP message: PHP Warning: Undefined array key “log_driver” in /var/lib/roundcube/program/lib/Roundcube/rcube_config.php on line 247’

SOLUTION
set the right permissions for file /etc/roundcube/defaults.inc.php
chmod 755 defaults.inc.php

2 Likes

Thank you, it worked bro. I hope you’re having a good day.

1 Like

I must thank you for your tutorial. When I first installed HestiaCP on my Ubuntu 22.04 LTS, everything worked except webmail. After, I implemented your tutorial, webmail works fine :slight_smile:

1 Like