Removing default apache install

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Removing default apache install

Post by alex.barylski »

So I've switched to plain Debian and dropped Ubuntu.

I installed debian with the options of WebServer, File Server, etc enabled...

I then downloaded and installed ApacheFriends but when I goto start XAMPP I get an error notifyinf me an Apache is already running...

I figured it's because at install I decided to install those Web, File, Mail services so it's somehow part of the system boot.

I did an

Code: Select all

apt-get remove apache(2)
(2) means I tried both apache and apache2

I don't want the Apache that installed at system install I want the ApacheFriends version to run so PHP and everything works :)

Can someone explain how this can be done?

When I installed ApacheFriends I did so by downloading the tar and uncompressing, which I think just copies working files, into appropriate directories and maybe run's a batch or something? I don't think this can be uninstalled using apt-get???

Whereas the default apache which installed at install time, should be, no???

Thanks :)
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

It may be called httpd(2). I seem to remember it being called that a while a go, but they may have changed it.

Your other option would be to just leave it, but ensure that it doesn't start on boot... (/etc/rc* | /etc/init.d)
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

The best way is to stop the existing apache service rather than removing it or point the default apache to some other port or as said by nickvd remove it from /etc/rc/httpd, the script doesn't start during the boot.
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

Code: Select all

dpkg -l
Will give you a list of all installed packages so you can have a look through the list for the actual package name. I've never run the default/bundled Apache install within Debian so I don't know what it comes under.

If you use apt to install a package, then I'd recommend using apt to remove the package also. Debian's apt system gets a bit funny if you manually remove (an entire or parts of) a package manually.

You don't have to remove the default Apache install as already mentioned, although if you're not using it, there is no point in having it installed. On a standard Debian system startup/shutdown scripts live in /etc/init.d/ and are symlinked in /etc/rcX.d/ where X is the startup runlevel. It's adviseable to add and remove startup/shutdown scripts using the 'update-rc.d' utility rather than doing so manually.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

I really need to start reading up on tinkering with Linux - I've been so damn busy with PHP I haven't able to...

Anyways, thanks for the help guys, always appreciated :)

One thing:

I ran dpkg -l and it certainliy listed all my goodies, but it did not list ApacheFriends (which I assume because it was not installed using apt, dpkg, etc) which is cool. It did however list a TON of apache crap, which if I'm not using, I would rather get rid of, for both experience and for the sake of doing it right. If I apt-get remove does that update init.d files so Apache will stop loading on bootup?

I also noticed a bunch of X windows stuff, which I don't need as I never plan on having any Windowing system on this computer, purely CLI.

Do I remove each of those packages individually? Can you specify something of a MASK using regex which would remove others as well?
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

The output from 'dpkg -l' should also offer a short description of each of the packages listed. Have a look at the descriptions for the Apache packages, one of them is probably described/listed as a 'meta package'. If you remove this one it should remove all the Apache packages, this should also remove any associated startup/shutdown scripts. You should double check that though, and also double check that the config files have been removed (apt-get remove) tends to leave some config files behind.

If any config files have been left behind....

Code: Select all

dpkg --purge <packagename>
.. should get rid of anything lurking around.

You are correct, ApacheFriends would only show on the list if it was installed as an actual Debian package.

I'm not entirely sure if you can specify a mask or 'match pattern' as such but you can remove multiple packages at once by listing each name individually i.e....

Code: Select all

apt-get remove <packagename> <packagename> <packagename> <packagename>
Post Reply