Installing Apache from the distribution packages gives Ubuntu or Debian hosts a supported web server for static sites, reverse proxies, and application front ends. Using the packaged build keeps security updates, log paths, service management, and helper commands aligned with the operating system.
On both distributions, the web server is delivered by the apache2 package and managed by the systemd unit apache2.service. The packaged layout keeps global settings in /etc/apache2/apache2.conf, the default site as 000-default.conf under /etc/apache2/sites-available, enabled sites in /etc/apache2/sites-enabled, and follow-on helpers such as a2enmod and a2ensite for module and site management.
A completed install should pass apache2ctl configtest, show the apache2 service active in systemd, and return 200 OK from http://127.0.0.1/. On many hosts the package post-install step starts Apache automatically, while the common AH00558 warning only means a global ServerName is not set yet. Remote clients also need port 80 allowed through the active firewall before they can reach the default page.
$ sudo apt update
$ sudo apt install apache2
The package also installs apache2ctl, a2enmod, and a2ensite, keeps the default site as 000-default.conf under /etc/apache2/sites-available, and serves the packaged landing page from /var/www/html.
$ sudo apache2ctl configtest AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.0.2.10. Set the 'ServerName' directive globally to suppress this message Syntax OK
The AH00558 line is a hostname warning, not an install failure. Syntax OK confirms the packaged configuration parsed successfully.
$ sudo systemctl enable --now apache2
If the package already started the service during installation, this command still makes the boot state explicit.
$ sudo systemctl is-active apache2 active
If the unit is not active, inspect sudo journalctl -u apache2 and /var/log/apache2/error.log before retrying.
$ curl --head http://127.0.0.1/ HTTP/1.1 200 OK ##### snipped #####
A 200 OK response proves the default virtual host is listening on port 80 and serving content from the packaged web root.
$ sudo ufw allow Apache
Current Ubuntu packages install the Apache, Apache Secure, and Apache Full UFW profiles. On Debian or on hosts that use nftables, iptables, or cloud firewalls instead of UFW, apply the equivalent rule in the active firewall stack.