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
- Log in via SSH. Use your terminal to connect:
ssh root@your-server-ip. If you use a non-root user, prependsudoto the commands below. - Check if Virtualmin services are running. Run
systemctl status virtualmin(orservice virtualmin statuson older systems). Also check webmin:systemctl status webmin. If they’re not running, start them withsystemctl start virtualmin webmin. - Verify Apache and MySQL/MariaDB. Virtualmin depends on these. Check with
systemctl status apache2(orhttpd) andsystemctl status mysql(ormariadb). If they’re down, start them. If they fail to start, check their logs (e.g.,journalctl -u apache2) for errors. - 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. - 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. - Check for disk space and inodes. A full disk can cause Virtualmin to fail. Run
df -handdf -i. If any partition is at 100%, free up space by removing old backups or logs. - Examine Virtualmin logs. Look at
/var/log/virtualminand/var/log/webminfor error messages. Search for “ERROR” or “FATAL” lines. These often point to the exact problem. - Check configuration file syntax. Virtualmin stores configs in
/etc/webminand/etc/virtualmin. Runperl -c /etc/webmin/virtual-server/configto check syntax. If there’s an error, edit the file and fix the issue. - Restart all services. After any fixes, restart everything:
systemctl restart apache2 mysql virtualmin webmin(or the appropriate service names). - 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/webminand/etc/virtualminto a safe location. - Check file permissions. Virtualmin files should be owned by root. Run
chown -R root:root /etc/webmin /etc/virtualminif they’re not. - Use the command-line tools. Virtualmin includes
virtualmincommand-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 -tlnpto see what’s listening. - Look at the Webmin error log.
/var/webmin/miniserv.erroroften contains detailed error messages. Tail it:tail -f /var/webmin/miniserv.errorwhile 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 -fand ensure it resolves correctly. If not, update/etc/hostsand/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
- Philips DST7060/20 7000 Series Iron: Specs & Fit
- Coal Fueled Jet Aircraft: Could It Work?675 L
- Remote Desktop on Raspberry Pi: How to Enable It
- Word Select Last Line in Paragraph?
- Google Assistant IFTTT Recipes: 7 Useful Automations
- OLED TVs in Dark Rooms: Why They Look Better and When They Don’t