<\/span><\/h2>\n\n\n\nTo install the Apache Web server, it executes the following command:<\/p>\n\n\n\n
sudo apt install apache2 -y<\/pre>\n\n\n\nOnce installed, start and enable the service.<\/p>\n\n\n\n
sudo systemctl enable apache2 && sudo systemctl start apache2<\/pre>\n\n\n\nCheck if the service is up and running:<\/p>\n\n\n\n
sudo systemctl status apache2<\/pre>\n\n\n\nYou should receive the following output:<\/p>\n\n\n\n
root@host:~# sudo systemctl status apache2\n\u25cf apache2.service - The Apache HTTP Server\n Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\n Active: active (running) since Wed 2023-07-19 08:58:22 CDT; 4s ago\n Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\n Process: 119547 ExecStart=\/usr\/sbin\/apachectl start (code=exited, status=0\/SUCCESS)\n Main PID: 119576 (apache2)\n Tasks: 6 (limit: 4557)\n Memory: 15.8M\n CPU: 556ms\n CGroup: \/system.slice\/apache2.service\n<\/pre>\n\n\n\n