Changing Listen port breaks httpd

I've fixed this but am reporting it as a bug as I guess you'll want investigate and fix in Virtualmin. This has also happened on two fresh installs.

Changing the listen port, in /etc/httpd/conf/httpd.conf and through Virtualmin settings:

- Virtualmin - System settings - Server Templates - Default Settings - Apache Website - Port number for virtual hosts: 8080
- And through Virtualmin - server configuration - Change IP Address

Causes httpd to break and fail to start up - reporting that bind cannot start because port has already taken. Googled for ages, and it seems this happens usually when 'Listen' has been set more than once. Sure enough, going through the various files this is what happened - with Virtualmin (or the system) setting the Listen port again in /etc/httpd/conf.d/ssl.conf underneath the 'Listen 443' line, uncommenting the duplicate `Listen' lines and Apache starts up fine.

Status: 
Closed (fixed)

Comments

Can you post the duplicate Listen lines on this ticket? I'm curious to see if they are exactly the same..

Sure:


# When we also provide SSL we have to listen to the
# the HTTPS port in addition.
#
Listen 443
#Listen 176.92.143.173:8080
#Listen [2a01:458:160:21a9::2]:8080

That's odd, none of these Listen lines appear to be for duplicate ports. Are there other Listen lines elsewhere in the Apache config?

No, just the one in /etc/httpd/conf/httpd.conf.

I checked my CentOS 6 install too, and they don't appear in the ssl.conf, it just has the single Listen 443 line.

I'm not seeing where the duplicate Listen directives are then?

Do you see duplicates in /etc/httpd/conf.d/ssl.conf? (As per my first post?)

Ok, I think I see the issue here now - in the next Webmin release, I will add protection against duplicate Listen lines.

Automatically closed -- issue fixed for 2 weeks with no activity.