0

I need to completely remove apache2 but no matter what I do I still get the default ubuntu page and when I run a nodejs app it will say port 80 is in use.

I tried the usual suggested in other apache2 removal questions:

sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove

rm -rf /usr/sbin/apache2
rm -rf /etc/apache2

$ sudo lsof -i :80

COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
chrome  2426 physiii  184u  IPv4  31202      0t0  TCP desktop:54128->151.101.193.69:http (ESTABLISHED)
chrome  2426 physiii  248u  IPv4  27504      0t0  TCP desktop:54038->151.101.193.69:http (ESTABLISHED)
chrome  2426 physiii  258u  IPv4  27510      0t0  TCP desktop:33542->174.76.226.31:http (ESTABLISHED)

I still get "Apache2 Ubuntu Default Page" if I go to 127.0.0.1

What is going on?

7
  • Did you reboot? Feb 27, 2017 at 2:45
  • 1
    Edit your post to include the output of sudo lsof -i :80, please.
    – muru
    Feb 27, 2017 at 5:53
  • Note: sudo in sudo lsof -i :80.
    – muru
    Feb 27, 2017 at 14:40
  • Just noticed that :) updated.
    – physiii
    Feb 27, 2017 at 14:43
  • Something's clearly changed - your older output had a connection to localhost, which is no longer present. Do you still have something running on port 80? I doubt it.
    – muru
    Feb 28, 2017 at 5:45

1 Answer 1

4

In my case, these commands helped me to fully remove apache2.

$ sudo apt-get remove apache2*
$ sudo apt-get autoremove
$ sudo apt-get autoclean
$ sudo rm -rf /etc/apache2 /var/lib/apache2 /var/lib/apache2
3
  • 1
    Still there. I'm using 16.04
    – physiii
    Feb 27, 2017 at 3:36
  • After the page loads to default apache page. Refresh it again. Feb 27, 2017 at 3:46
  • 2
    Nope. I can't start a program on port 80. Apache is still binding that port somehow!
    – physiii
    Feb 27, 2017 at 4:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.