This (port conflict) was handled in the script a while ago. Needing to proxy is a whole other deal there are howto topics on that.
This is the guide that the script links to but I donāt want to tear down my production website just to install discourse.
This guide assumes you already have Discourse working - if you don't, it may be hard to tell whether or not the configuration is working.
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ā¦
From your description, the best way to know if another upgrade is going to cause a problem is to upgrade three days in a row - it really should be easy enough that that is workable!
In general, expect that if itās been a year+ since your last Discourse upgrade, youāll need ./launcher rebuild app
. I recommend visiting /admin/upgrade more frequently of course
If you app.yml called something else you need to
./launcher stop irrelevant
Or rename it and rebuild that.
Discourse installs nothing outside the container aside from docker as an installation prerequisite.
Itās likely Apache2 was installed after the last reboot and couldnāt take the port until you restarted the machine. Grep your bash history to check what packages have been installed by hand.
Thanks for the ideas everyone.
I did use rebuild app. And if Discourse installs nothing extra (was thinking nginx and Apache2 would come by default because of something new)ā¦ hmmm. I certainly havenāt added Apache2 myself.
Ah. After having this DigitalOcean Ubuntu for Discourse only for years and years I actually installed Subversion in January, apparently without rebooting. That install apparently adds Apache although disabling it still leaves me with the functionality I need.
Guess Iām not so used to installs adding garbage (yes Iām sure Apache is needed for something). That more commonly happens on like, Windows or Android .
Sorry for the trouble. Then again, this is a real use case scenario, always good to read those as a developer.