keepcalculator

06 Numbers and Powers

How to Fix a Failed Virtualmin Installation

Card No. 06·12821 · Updated · Standard formula, shown below

Virtualmin is a powerful web hosting control panel, but when an update or configuration change goes wrong, it can leave your server inaccessible. This guide walks you through diagnosing and repairing a failed Virtualmin installation, from checking services to re-running configuration scripts. You’ll need root or sudo access to your server via SSH, and a basic comfort with the command line.

What You’ll Need

  • SSH access to your server with root or sudo privileges
  • The server’s IP address or hostname
  • A text editor (like nano or vim) for editing configuration files
  • Basic familiarity with Linux command line commands

Step-by-Step

  1. Log in via SSH. Use your terminal to connect: ssh root@your-server-ip. If you use a non-root user, prepend sudo to the commands below.
  2. Check if Virtualmin services are running. Run systemctl status virtualmin (or service virtualmin status on older systems). Also check webmin: systemctl status webmin. If they’re not running, start them with systemctl start virtualmin webmin.
  3. Verify Apache and MySQL/MariaDB. Virtualmin depends on these. Check with systemctl status apache2 (or httpd) and systemctl status mysql (or mariadb). If they’re down, start them. If they fail to start, check their logs (e.g., journalctl -u apache2) for errors.
  4. Run the Virtualmin repair script. Virtualmin provides a script that attempts to fix common issues. Run: /usr/share/webmin/virtualmin/repair. Follow any prompts. This will check and repair permissions, configuration files, and database tables.
  5. Re-run the Virtualmin configuration script. If the repair script doesn’t help, re-run the setup: /usr/share/webmin/virtualmin/install.pl. It will ask to keep existing configuration—choose to keep it to avoid overwriting your settings. This can regenerate missing or corrupted files.
  6. Check for disk space and inodes. A full disk can cause Virtualmin to fail. Run df -h and df -i. If any partition is at 100%, free up space by removing old backups or logs.
  7. Examine Virtualmin logs. Look at /var/log/virtualmin and /var/log/webmin for error messages. Search for “ERROR” or “FATAL” lines. These often point to the exact problem.
  8. Check configuration file syntax. Virtualmin stores configs in /etc/webmin and /etc/virtualmin. Run perl -c /etc/webmin/virtual-server/config to check syntax. If there’s an error, edit the file and fix the issue.
  9. Restart all services. After any fixes, restart everything: systemctl restart apache2 mysql virtualmin webmin (or the appropriate service names).
  10. Test the Virtualmin interface. Open your browser and go to https://your-server-ip:10000. If it loads, try logging in. If not, check that the webmin service is listening on port 10000: ss -tlnp | grep 10000.

Common Mistakes

  • Ignoring service dependencies. Starting Virtualmin before Apache or MySQL is up can cause failures. Always start the underlying services first.
  • Overwriting configuration during re-install. When running install.pl, selecting “new” instead of “keep existing” can erase your virtual servers and settings. Always choose to keep existing config unless you’re sure.
  • Editing files without backup. Before changing any config file, copy it: cp /etc/webmin/virtual-server/config /etc/webmin/virtual-server/config.bak. This lets you revert if needed.
  • Forgetting to check SELinux or AppArmor. On some distributions, these can block Virtualmin. Check if they’re enabled and temporarily disable them to test (then re-enable with proper policies).

Tips

  • Use the Virtualmin documentation. The official Virtualmin wiki has troubleshooting guides for common errors. Search for the specific error message you see.
  • Keep a backup of your configuration. Regularly back up /etc/webmin and /etc/virtualmin to a safe location.
  • Check file permissions. Virtualmin files should be owned by root. Run chown -R root:root /etc/webmin /etc/virtualmin if they’re not.
  • Use the command-line tools. Virtualmin includes virtualmin command-line scripts (e.g., virtualmin list-domains) that can help diagnose issues without the web UI.

Troubleshooting

If the steps above don’t resolve the issue, try these additional checks:

  • Check for port conflicts. Ensure nothing else is using port 10000 (Webmin) or 80/443 (Apache). Use ss -tlnp to see what’s listening.
  • Look at the Webmin error log. /var/webmin/miniserv.error often contains detailed error messages. Tail it: tail -f /var/webmin/miniserv.error while trying to access the UI.
  • Try a different browser or clear cache. Sometimes the issue is client-side. Test with incognito mode or a different browser.
  • Check DNS and hostname. Virtualmin relies on the server’s hostname. Run hostname -f and ensure it resolves correctly. If not, update /etc/hosts and /etc/hostname.
  • Reinstall Virtualmin from scratch (last resort). If nothing works, you can reinstall Virtualmin completely. First, back up your virtual server configs in /etc/webmin/virtual-server. Then remove and reinstall the virtualmin package. This is drastic, but it often fixes persistent corruption.

Frequently Asked Questions

Q: I can’t access the Virtualmin web interface at all. What should I do first?

A: First, ensure the webmin service is running (systemctl status webmin). If it’s not, start it. Then check if port 10000 is open in your firewall (e.g., ufw allow 10000). If it’s still not accessible, check the miniserv.error log for clues.

Q: After an update, Virtualmin shows a blank page. How do I fix it?

A: A blank page usually indicates a PHP or Perl error. Check the Apache error log (/var/log/apache2/error.log) and the Webmin error log. Also, try running the repair script, as it often resolves permission issues after updates.

Q: Virtualmin says “Cannot connect to MySQL”. What does that mean?

A: This means the MySQL/MariaDB service is either not running or the Virtualmin database user’s credentials are wrong. Start MySQL, then check the credentials in /etc/webmin/virtual-server/config (the mysql section). You can reset the root MySQL password if needed.

Q: Can I fix Virtualmin without losing my websites and email accounts?

A: Yes, in most cases. The repair and re-install scripts are designed to preserve your configuration. Always choose “keep existing” when prompted. Your actual website files in /home and email in /var/mail are not touched by these scripts.

Q: The repair script says “No virtual servers found”. Is my data gone?

A: No, your data is likely still there, but Virtualmin’s database may be corrupted. Check the /etc/webmin/virtual-server directory for backup files like domains.backup. You can restore them by copying them to domains and restarting Virtualmin.

Q: How do I prevent future failures?

A: Regularly back up your Virtualmin configuration and database. Use the built-in backup feature to create full backups of your virtual servers. Also, always take a snapshot of your server before performing major updates.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →