Installed Virtualmin, apache configuration errors

SYSTEM INFORMATION
OS type and version Debian 12
Virtualmin version 7.40.0

I’ve installed Debian 12 on a fresh VPS.
I’ve run the installation command and it was succesful. I’ve installed version Virtualmin Virtual Servers Version 7.40.0

When I log in and complete the wizard, it shows:

**Warning!** The Apache configuration on your system has errors! This will prevent any new domains from being fully added by Virtualmin until the errors are fixed.

AH00526: Syntax error on line 3 of /etc/apache2/ports.conf: Cannot define multiple Listeners on the same IP:port Action 'configtest' failed. The Apache error log may have more information.

When I check the ports.conf it shows:

Listen 80
Listen 443
Listen 80
Listen <my ip>:443
Listen 80
Listen <my ip>8:443
Listen [<my ip v6>]:443

Any idea why this happens?

After some more googling I found this user with the same issue: Apache error: AH00526: Cannot define multiple Listeners on the same IP:port

Also, when checking the installation logs:

[2025/09/12 11:29:01] [INFO] - Configuring Virtualmin
[2025/09/12 11:30:19] [INFO] - Code: 0 Result: 
[2025/09/12 11:30:19] [INFO] - Succeeded
[2025-09-12 11:30:20 UTC] [DEBUG] SSL certificate request for the hostname : 0 : Failed to set up SSL certificate for the <my hostname> hostname
[2025-09-12 11:30:20 UTC] [DEBUG] Cleaning up temporary files in /tmp/.virtualmin-18803.
[2025-09-12 11:30:20 UTC] [DEBUG] Primary address detected as <my ip>
[2025-09-12 11:30:20 UTC] [SUCCESS] Installation Complete!

see this looks like the same problem

look near the bottom of the thread for a work around

1 Like

Thank you, that seems to work. I’ve removed the double lines from ports.conf (not sure if that’s necesarry and
I’ve removed the file
0-.conf from /etc/apache2/sites-available and /etc/apache2/sites-enabled and now the error is gone.

for anyone reading this, you do need to remove the duplicate port entries.
glad you fixed it

Both of these issues, like the incorrect port declaration in ports.conf and the Apache site config not clearing after an SSL request for the hostname during the initial installation, are related to a bug in the current Virtualmin Config v7.0.21.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.