recently I tried to install an apache webserver on an ubuntu machine. I discovered two ways to do that.
The first one is to install it like it is described at this source apache docs using ./configure, make, make install
to the downloaded apache sources.
And the second way is to install it via apt-get update && apt-get install apache2
.
I also noticed that when I run the installation via apt-get it seems that there is a different configuration of the apache for example the directory /etc/apache2/*
is only available over this way of installation. So when I install it manually the directories sites-available, sites-enabled, ...
are just missing.
Is there also a way to get these folders when running the manual installation?
Where do this differences come from?
CodePudding user response:
This is nothing that can be summed up in a few sentences. You basically ask: how does software management work under Linux systems? In short:
using the
apt
utility on a Ubuntu based system you are using the systems package management system, that should nearly always be what you want. That way the system can take care to keep your apache installation up to date, you can remove software again without leaving artefacts, the software is guaranteed to work with the system libraries already installed in your system. Potential conflicts are resolved. You can be certain that the configuration matches your system.using the build system is a more generic (archaic) way: you do not only install the software, you build it from scratch from the software sources prior to installing it. That is only possible for OpenSource software, obviously. This certainly allows for more flexibility. But you are responsible yourself for a whole lot of things, starting with first setting up a complete build system, then configuring the package, select what you actually want to build and last but not least you are yourself responsible to update software you installed that way. This rarely is a good idea, with two exceptions:
- you absolutely cannot find a pre build package for your Linux distribution or
- you want to make own modifications to the software itself
The difference in the folder layout of the apache configuration is a separate thing. There are two aspects that come into play here:
- you can change that layout using the uncounted build options offered by the build system (namely the options you can hand over to the
configure
utility on the command line). - typically the configuration of complex software packages (like the apache http server with all it's modules) is broken up into
- various sub folders so that you can keep an overview and
- allows additional packages to drop their additional configuration in place (this is mostly useful for prebuild packages)
Long story short: in 99,8% of all cases you want to use prebuild packages prepared for your distribution. That is the power of the software management systems under Linux (that still have no comparable counterpart in other operating systems).