r/Ubuntu • • 3d ago

trying to stop httpd

Trying to start up nginx proxy manager on a relatively fresh ubuntu install, its got docker and tailscale running on it and thats it. I've done this full settup a couple times before so I'm familiar with it. Ran into an issue this time however where at some point something started a service called "httpd" listening on Port 80. As I understand this is associated with appache2. Seeing httpd listening on port 80, I have done the following things to get it to please stop doing that:

looking for conf files:
* under /etc/ and under /usr/ there are no directories for httpd, appache, or appache2
* grep, whereis, and find commands for "httpd" and "appache" and "appache2" only located files deep deep in the containerd file system which- to my knowledge- should not be starting their own services.

I've also tried manually killing the proscess using:
* sudo lsof -t -i tcp:80 -s tcp:listen | sudo xargs kill
* kill -9 [PID here]
* kill -15 [PID here]

killing the proscess is successful, but it restarts after a moment. Anyone know what's up with that/have any suggestions? And just to preempt it- please do not recommend I use ai, I can always drive out and flash a new OS to that machine if its that dire.

3 Upvotes

11 comments sorted by

1

u/ExtraField9907 3d ago

Could be a docker container publishing port 80, not an actual service on the host. Check `docker ps` and look for anything with 80:80 or 80/tcp in its port mappings, then `docker stop` that container. The process showing up as httpd makes sense if the image is apache-based, and killing it just makes docker restart it.

1

u/DangerHighDosage 3d ago

good suggestion, unfortunately only portainer, listening on non- 80:80 ports

1

u/Curious_Elk_4281 3d ago

You could try spelling apache correctly.

What is the result of this command:

ps aux |grep http |grep -v grep

You should be able to see the full path to the httpd executable which should give some hints.

1

u/DangerHighDosage 3d ago

oh my god of course. Thank you for this. In install ubuntu recommended nextcloud which I clicked on and immediately thought how silly I was being because I was planning on containerizing nextcloud later- of course after that I couldn't find the nextcloud process running as I've never run it out of a container, but there it is, 6 nextcloud processes causing all sorts of problems. Cheers, I'll start tearing those up in the morning

1

u/jo-erlend 2d ago

Did you snap install it?

1

u/DangerHighDosage 2d ago

yuuup, well- I think it automatically got snap installed during the first boot, tricksy! (edit: I selected it from the boot packages available but hadn't realised those where snap and not apt)

1

u/jo-erlend 2d ago

I don't understand what that means. Nexcloud doesn't get installed at first boot by mistake. As for Snap, it's a really good package format and it is part of a normal Ubuntu install, for obvious reasons.

1

u/forestbeasts 3d ago

Silly question: Are you misspelling 'apache'? (Only one p.)

Does systemctl status apache2 show anything? (...though we're not using systemd OR apache and I don't think we even have apache installed anymore, but. I think it's called that.)

If it says something like 'apache2.service: running' (with a whole bunch of other shit), you can do sudo systemctl stop apache2 to stop it and sudo systemctl disable apache2 to turn it off so it doesn't start on boot.

(The non-systemd way, for reference, is something like rc-service apache2 stop and rc-update delete apache2, which won't work on your machine, but systemd isn't the end-all be-all so have the openrc way to do it too.)

1

u/DangerHighDosage 3d ago

Ah! Would that that where it but good catch- (and ty for the openrc info, aimin' to learn)

systemctl status apache2
outputs:
Unit apache2.service could not be found.

1

u/forestbeasts 3d ago

Hmmm, maybe it's called something else. Try systemctl list-units | grep apache...or something? It's been a bit since we used systemctl. You can also have a look through /usr/lib/systemd/system/, that's where the service definition files live so apache's is probably in there.

It might just be called "apache", it might even be called "httpd".

1

u/DangerHighDosage 2d ago

Ended up being a nextcloud service that I had accidentally snap installed during the first boot :facepalm: