Since this topic was helpful I’ll just add to it even if it’s 3 years old. I encountered the port in use problem today and am somewhat baffled by what happened. Just showing order of events in case someone else runs into it.
Background: Running Ubuntu 16.04.3 LTS (far too scared to upgrade to 18.04) and Discourse 2.3.x (not sure which, reason for that later
).
Did a change (irrelevant) to app.yml and rebuilt the app.
Also noticed Ubuntu wanted to restart (didn’t check the reason) so rebooted Ubuntu as well.
And ended up with the port error problem.
Figured out Apache2 was suddenly running so I disabled it:
root@Discourse:~# sudo update-rc.d apache2 disable
insserv: warning: current start runlevel(s) (empty) of script apache2' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script apache2’ overrides LSB defaults (0 1 6).
And got the forum back up eventually as the port was now free.
What I cannot figure out is why this happened? Where did Apache2 come from?
I should have tested the forum immediately after the restart, dang. Now I don’t know whether the Discourse upgrade or the Ubuntu restart was responsible for this (I can probably find that in some log but I’m not any good with Linux anymore). Even tried to find on the forum if Discourse 2.5 installs Apache2 these days.
Good thing is, upgrading Discourse was long overdue. I’m just very reluctant to upgrade nowadays since I’ve had problems like this every second time or so in the past 5 years. Still love Discourse though…