After an update and server restart, Apache fails to start due to duplicate Listen directives in apache vitalpbx.conf

Issue: After restarting the server, the Apache service failed to start.

Cause: The configuration file /etc/apache2/sites-enabled/vitalpbx.conf contained duplicate Listen directives for the same ports, resulting in the error “Cannot define multiple Listeners on the same IP:port”.

Context: Prior to the restart, an update was performed on the server without a subsequent restart. When the server was finally restarted, the port conflict issue became apparent. Additionally, this server operates with a custom HTTPS port.

Resolution: The duplicate Listen directives were removed from the specific configuration file, and port management was centralized in the main Apache configuration file. This resolved the port conflict and allowed the Apache service to start correctly.

Steps Taken:

  1. Identified the issue by checking the Apache error logs.
  2. Used grep to find all Listen directives across Apache configuration files.
  3. Edited the /etc/apache2/sites-enabled/vitalpbx.conf file to remove the duplicate Listen directives.
  4. Ensured the custom HTTPS port configuration was correctly set.
  5. Restarted the Apache service to ensure it started without errors.

Recommendation: It is recommended to fix the issue in the update process that leads to duplicate Listen directives being created. By addressing this problem at the source, future updates can avoid causing service disruptions and ensure smoother operation post-restart.

The VitalPBX config file for Apache doesn’t come with duplicated Listen directives.