Score:0

Cannot Start Apache2 - httpd bound to port 80

la flag

I have a fresh install of Ubuntu Server 22.04, on which I installed apache2 via apt-get install After the installation I got the following error whenever I tried to start Apache2:

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

After some investigation, I found that httpd was already bound to port 80 and preventing Apache2 starting. I hadn't realised that this version of Ubuntu Server came pre-installed with Nextcloud (via snap) which obviously already had a webserver to run!

Killing the process doesn't seem to work, as it just springs back up again before I can restart apache2.

There is no /etc/httpd directory and the /etc/apache2/ path relates to my installation that can't start, so how do I find the config files of the mysterious apache server that is already running?

I would eventually want to have Nextcloud running on this system but my primary goal is to have a running webserver to serve pages locally on the network.

Thanks in advance

James

Ptit Xav avatar
pn flag
Try : ps -eaf | grep http This may give you the path of the installed apache server. You can also try : lsof | grep 80
Bushkin avatar
la flag
Thanks Ptit, this confirmed that the httpd instance was inside the Nextcloud snap container
Score:0
ws flag

I hadn't realised that this version of Ubuntu Server came pre-installed with Nextcloud

So presumably you would be happy to get rid of it.

Check the spelling (and capitalization) of the package name using snap list, then remove the package with snap remove nextcloud (or whatever name its using).

Bushkin avatar
la flag
Great, thanks - that lets Apache2 start and bind successfully. I have not used snap / containerised systems before - it seems strange to me that nextcloud includes it's own apache instance that conflicts with a traditional instance of apache as in this case?!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.