Tuesday, January 25, 2011

I cant get rid of apache2

It's obvious that I am a newbie with server amministration, my goal is to reach the knowledge needed to working with web services.

I played with my debian server, and i messed up apache2; Now i want to completely* remove it from the server and then reinstall it as new.

*for completely i really mean completely, logs, configurations, settings, everythings!

I followed the steps suggested by freedom_is_chaos in this answer, and i guess apache2 is nomore installed, becose if i do apt-get remove apache2 i get this:

# apt-get remove apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package apache2 is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

# dpkg --remove apache2
dpkg - warning: ignoring request to remove apache2 which isn't installed.
# dpkg --purge apache2
dpkg - warning: ignoring request to remove apache2 which isn't installed.

Then, i rebooted the server, and:

# netstat -plant
Active Internet connections (servers and established)
[...]
tcp6       0      0 :::80                   :::*                    LISTEN      3467/apache2
[...]

WTF? is apache2 still here? So seem:

# /etc/init.d/apache2 stop
Stopping web server: apache2.

But:

# update-rc.d remove apache2
update-rc.d: /etc/init.d/remove: file does not exist

So, what is happening to my server? How can i completely and truly remove apache2 from my server?

EDIT: as usually happen, the problem was between the chair and the keyboard ;)

I dont know how, but while i was 'playing' with the server configuration i installed for mistake apache2.2, dpkg -l | grep 'apache' showed me some other libs still installed; once removed them, i've been able to completely remove and reinstall apache2 (with the --purge option)

  • Here you go:

    sudo aptitude purge ~iapache2
    

    Although this would have been sufficient:

    sudo update-rc.d apache2 disable
    
    From Tobu
  • you could try

    sudo apt-get remove apache2 --purge
    

    and for removing the rc.d files try

    sudo update-rc.d apache2 remove -f
    
    DaNieL : updated my question
    From Paul

0 comments:

Post a Comment