Check if Apache is installed on a Ubuntu machine
You can use the below commands to check if Apache is installed or not:
dpkg --get-selections | grep apache
or
apache2 -v
Command:
dpkg --get-selections | grep apache
Output:
apache2 install
apache2-bin install
apache2-data install
apache2-utils install
Command:
apache2 -v
Output
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2019-10-08T13:31:25