Checking If Apache Is Installed Or Not
Apache is the most deployed web server in the world. There's no doubt that it runs the internet. Apache can run on both Linux based Operating Systems and the most recent versions of Windows Server.
Although Apache's documentation is actively updated, the configuration and its directories can change quite a bit and leave you wondering where Apache is have installed. Or if the web server is even installed, for that matter. Let's walk through some of the necessary steps in identifying where Apache is installed.
Check for the Apache process running.
The quickest way to check if Apache is running is to check for a running process.
Let's run the following command:
ps aux | grep apache
ps aux | grep httpd
In the case of my example, we can see we have multiple child processes created by "apache2", so the web server is definitely installed on this Linux server.
Check open files with the name Apache
Another excellent method to check if a process is running is to check for files open with that process name. We can leverage a built-in tool called "lsof"; most operating systems have it installed by default. It checks for open files in the system with a specific name when we use the command "grep". Let's try it for Apache.
lsof | grep "apache"
Notice all of these files that are currently open by the command. That is yet another confirmation that Apache is installed.
Other ways to check for Apache
There is one more way I will show you to find if Apache is installed quickly.
These days, most Linux systems rely on "SystemD" for service management, so we'll leverage that to check for an installed or running Apache service by various names.
systemctl status apache
systemctl status apache2
systemctl status httpd
And there you have it. Those are multiple ways you can check if Apache is installed or running by various names.